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:
in acf-input-osm.js at line 570 (at the end of update_map);
in acf-field-openstreetmap.js at line 16183 in acf_leaflet;
and finally, the most important part in my case since OSM field loads in an ACF tab:
acf.addAction( 'show_field/type=open_street_map', function( field ){
var editor = field.$el.find('[data-editor-config]').data( '_map_editor' );
editor.update_visible();
});
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 :)
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:acf-input-osm.js
at line 570 (at the end ofupdate_map
);acf-field-openstreetmap.js
at line 16183 inacf_leaflet
;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 :)