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 Thomsen aseerel4c26 ♦ |
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. answered 20 Oct '14, 21:00 aseerel4c26 ♦ |
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. answered 20 Oct '14, 17:09 avatar06349 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! answered 20 Oct '14, 18:58 stephan75 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
|
do you mean that you want to do (web) development for your own project? Just to make this clear.
Spot on - I want to implement a print function in my own web project!
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"?
My question is about how to implement a share image (print) function on my own webproject similarly to the share function, that OSM use.