mcguffin / acf-openstreetmap-field

WordPress ACF Field for OpenStreetMap
https://wordpress.org/plugins/acf-openstreetmap-field/
GNU General Public License v3.0
107 stars 21 forks source link

Option to output map as static (for printig etc) #31

Closed spa49 closed 4 years ago

spa49 commented 4 years ago

Hi again,

when trying to render a PDF on server side, the map field does not get shown. I suspect that is because the map is called dynamically. I think it would be nice to have the option to render map via the static API as PNG f.e. for such applications. So instead of building a DIV it just passes an image url to the shortcode Maybe it can be handled with a shortcode parameter like render-output = "static" so the settings for output can be overwritten.

what do you think?

mcguffin commented 4 years ago

Hmm. Using raw data return format you should be able to render the map through OSM static Maps, or tyler.

However, both services look a bit neglected to me ... I wouldn't rely on them on a production system.

I'll consider adding a static map template when I start working on the Template Overrides (#25) … and if I find a reliable static map service.

spa49 commented 4 years ago

Ja that sounds reasonable. Well I will have a look at the render on runtime option with RAW and Mapbox API Maybe for even caching/saving the static to disk or database until the map field has been altered. I think Mapboxs would also work if it needs to be rendered to print on runtime (like for frequently changing map info that needs printing or offline availability. Also, they offer a leaflet plugin called leaflet-image or how about just shooting an image of the maps DIV with html2canvas

mcguffin commented 4 years ago

<basic>goto #25</basic> ;)