NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

I love the 'Share' function, where the user can generate a picture of the map as a pdf. Especially the resolution of each tile is superb.

We have a OpenLayers map, where we use OpenStreetMap as background.And I would like to implement a print function similarly to the one, OpenStreetMap uses. Can I find any help about, how the print function works ?

asked 20 Oct '14, 15:13

Mads%20Thomsen's gravatar image

Mads Thomsen
16114
accept rate: 0%

edited 20 Oct '14, 20:20

aseerel4c26's gravatar image

aseerel4c26 ♦
32.6k18248554

do you mean that you want to do (web) development for your own project? Just to make this clear.

(20 Oct '14, 16:19) aseerel4c26 ♦
1

Spot on - I want to implement a print function in my own web project!

(20 Oct '14, 19:35) Mads Thomsen

Okay, and is your question about pdf generation a about the print function (not via pdf)? Or do you mean pdf generation by "print function similarly to the one, OpenStreetMap uses"?

(20 Oct '14, 20:21) aseerel4c26 ♦
1

My question is about how to implement a share image (print) function on my own webproject similarly to the share function, that OSM use.

(20 Oct '14, 20:37) Mads Thomsen

The www.osm.org's website's source is fully open (AFAIK). See The Rails Port in our docu wiki. So you can look up every bit you are interested in (and you can even re-use - "licensed under the GNU General Public License 2.0", see the readme/license file). For the "share" function a starting point would be /app/assets/javascripts/leaflet.share.js in the source tree.

For the Leaflet toolkit see leaflet in our docu wiki. It may work similarly with OpenLayers of course. You can look up much of the technical details of OSM-related software in our docu wiki.

In case you want to use other server's resources, please take care to obey the usage limits/restrictions. In case of osm.org's server: I do not know if linking to osm.org's server-side pdf generation is allowed at all as this is quite resource-demanding, I guess. But, as always, you can run it on your own server.

Note: I am not really involved in that development myself, however, I think that it may help.

permanent link

answered 20 Oct '14, 21:00

aseerel4c26's gravatar image

aseerel4c26 ♦
32.6k18248554
accept rate: 18%

edited 20 Oct '14, 21:07

This may or not be what you are looking for but this site will generate and pdf any map using openstreetmap that you can print.

http://www.maposmatic.org/

permanent link

answered 20 Oct '14, 17:09

avatar06349's gravatar image

avatar06349
16
accept rate: 0%

1

I looking for something more dynamic than MapOSMatic. When the user click the print button, the .pdf should be created on-the-fly behind the scene - just like the Share function at the osm site. So I'm asking, how this function is working - does it use a JavaScript print library or? When I do a normal window.print() the resolution isn't good enough when zooming.

(20 Oct '14, 19:41) Mads Thomsen

What about entering "print" or "pdf" in the search box of this FAQ site?

There have been already similar questions like yours. Tell us about Success or Failure!

permanent link

answered 20 Oct '14, 18:58

stephan75's gravatar image

stephan75
12.6k556210
accept rate: 6%

Actually - I have searched this FAQ for a solution - and I could not find the solution for my challenge... I'm not asking about, how I'm using the share / print function at the osm site! I'm asking about how to implement the same function at my own web site. And at the same time, I'm telling you, the the share function is a succes!!

(20 Oct '14, 19:57) Mads Thomsen
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×535
×113
×23
×18
×16

question asked: 20 Oct '14, 15:13

question was seen: 7,483 times

last updated: 20 Oct '14, 21:07

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum