bozdoz / wp-plugin-leaflet-map

Add leaflet maps to Wordpress with shortcodes
https://wordpress.org/plugins/leaflet-map/
GNU General Public License v2.0
142 stars 72 forks source link

Map Marker Displays Correctly While Logged Into Wordpress But Not for Logged Out Visitors #245

Closed Escondido closed 11 months ago

Escondido commented 11 months ago

I'm not sure when the issue cropped up, but I just noticed the map marker shows up correctly as a blue icon when I'm logged in. However, logged out it doesn't show up with any browser. All I see is a broken image and "mark" or "marker" depending on the browser (see attached)

I'm using the following

I tried deactivating all plugins and that didn't resolve the issue. Cleared all cache with the same outcome. It doesn't make sense it only shows up while logged into the website. I know it used to show up fine, I just can't pinpoint the problem.

Using Voxel tags the shortcode is as follows;

[leaflet-map lat=@post(location.lat) lng=@post(location.lng) zoom=14 zoomcontrol=1] [leaflet-marker lat=@post(location.lat) lng=@post(location.lng)]

It automatically pulls in the coordinates and shows the location.

Any suggestions on how to fix it? Thanks.

listing

hupe13 commented 11 months ago

Open the developer console of your browser and search any errors. Do you have an URL to a test page?

Escondido commented 11 months ago

I see two errors showing a 404 error code about the marker-icon and marker-shadow.

hupe13 commented 11 months ago

I can't acces the URL, I am being blocked (403 error).

Escondido commented 11 months ago

I have a lot of people trying to hack my website, so Cloudflare is blocking all traffic outside USA. What country is your ip address located and I'll whitelist it.

hupe13 commented 11 months ago

Germany.

Escondido commented 11 months ago

Should work now.

hupe13 commented 11 months ago

I guess either Elementor or a caching plugin is the reason. Try to use iconurl and the other options. You can use e.g. marker from https://github.com/pointhi/leaflet-color-markers, examples. Or use ExtraMarker from Extensions for Leaflet Map.

Escondido commented 11 months ago

I got it working now using the other plugin. Finally got my pagespeed score up to 100 by getting rid of Google maps, so I'm happy. Putting the code down below in case anybody else needs encounters the same problem.

[leaflet-map lat=@post(location.lat) lng=@post(location.lng) height=400px zoom=13 zoomcontrol=1] [leaflet-extramarker markerColor=orange-dark shape=circle lat=@post(location.lat) lng=@post(location.lng)]

I appreciate your help.