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

Leaflet JS map no longer displays #47

Closed robertandrews closed 2 years ago

robertandrews commented 4 years ago

This is no longer showing a map on the front-end.

It works fine in the back-end.

Here is the code that manifests in the front…

<div class="leaflet-map" data-height="350" data-map="leaflet" data-map-lng="7.0174313" data-map-lat="43.5507876" data-map-zoom="14" data-map-layers="[&quot;OpenStreetMap&quot;]" data-map-markers="[{&quot;label&quot;:&quot;Palais des Festivals, Boulevard de la Croisette, Cannes, France&quot;,&quot;default_label&quot;:&quot;&quot;,&quot;lat&quot;:43.5507815,&quot;lng&quot;:7.0174321}]"></div>

The following stylesheet is included at the bottom, and goes to a working file…

<link rel="stylesheet" id="leaflet-css" href="http://www.example.com/wp-content/plugins/acf-openstreetmap-field/assets/css/leaflet.min.css?ver=1.1.9" type="text/css" media="all">

That is with the Leaflet JS render setting enabled.

The iFrame render setting actually still works.

I don’t see any leaflet.js-type file at the bottom of source; don't know if that's necessary.

mcguffin commented 4 years ago

Is the script https://www.example.com/wp-content/plugins/acf-openstreetmap-field/assets/js/acf-osm-frontend.js?ver=1.1.9being loaded? Can you see any JS-errors in the Browser console?

frankypixels commented 4 years ago

It loads for me, but map still doesn't show. What would be blocking that?

frankypixels commented 4 years ago

This is the only js that I can find that loads .../wp-content/plugins/acf-openstreetmap-field/assets/js/acf-osm-frontend.min.js?ver=1.2.0

stef5962 commented 4 years ago

Hello,

I am using the ACF Openstreetmap Field 1.2.1 plugin and the following plugins: Elementor 3.0.3 + elementor pro 3.0.1 + Advanced Custom Fields 5.9+Insert PHP Code Snippet 1.31.1

I created a php snippet named [xyz-ips snippet = "carte-osm"] <? php $ note = get_field ('carteosm'); ?> <? php the_field ('carteosm'); ?>

which I display via "text editor widget elementor" with the php Snippet named [xyz-ips snippet = "map-osm"]

It was working perfectly and now I have the following error

The Leaflet card is all gray, there are only the + and - buttons at the top left and the leaflet link at the bottom right

with the following error in the Google Chrome console

JQMIGRATE: Migrate is installed, version 1.4.1 acf-osm-frontend.min.js? ver = 1.2.1: 1 Uncaught TypeError: Unable to read property 'OpenStreetMap' from null to e.initialize (acf-osm-frontend.min.js? ver = 1.2.1: 1) to the new e (acf-osm-frontend.min.js? ver = 1.2.1: 1) at Function.u.tileLayer.provider (acf-osm-frontend.min.js? ver = 1.2.1: 1) to String. (acf-osm-frontend.min.js? ver = 1.2.1: 1) at Function.each (jquery.js? ver = 1.12.4-wp: 2) at HTMLDivElement. (acf-osm-frontend.min.js? ver = 1.2.1: 1) at HTMLDivElement. (acf-osm-frontend.min.js? ver = 1.2.1: 1) at Function.each (jquery.js? ver = 1.12.4-wp: 2) at a.fn.init.each (jquery.js? ver = 1.12.4-wp: 2) on a.fn.init.acf_leaflet (acf-osm-frontend.min.js? ver = 1.2.1: 1)

Thanks in advance

scarlet959 commented 3 years ago

@mcguffin, Hoping you are doing good.

The "Leaflet JS map" issue seems to be occurring now also.

For me the error is "Uncaught No such variant of OpenStreetMap (Mapnik)" I have opened up a new thread with the details. if both these issues corresponds to the same, please merge the requests.

Thanks in advance.

mcguffin commented 3 years ago

@scarlet959 Thank you so much for asking! Health still okay, but big corona fatigue like (assumably) everbody else... Your issue looks a bit different so I answered in #66.

@robertandrews, @frankypixels Does the issue still occur in 1.3.2? @stef5962 Your case looks like the script can't find the provider settings. Can you provide me an URL where I can see what's actually going wrong?

frankypixels commented 3 years ago

@mcguffin No, now it's working again. Thank you.