mcguffin / acf-openstreetmap-field

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

Single tile loading #11

Closed ffoodd closed 4 years ago

ffoodd commented 5 years ago

Hi there,

Thanks to your previous release, this plugin is really easier to use :)

I still get some trouble when loading a map field in the admin area: a single tile is displayed. After some research, I found that it's probably due to teh script not being able to get the size of the final map to render.

The trick I found is to use map.getSize(); at some points:

at the end of acf-input-osm.js, Line 616.

I don't know if all of this is really useful or not, since I got here by testing in the wild… But at least that allowed me to suppress the single tile loading behavior where I needed to.

Please tell me if that sounds crap to you, or if you have any better way of doing this :)