• Resolved smokey2k

    (@smokey2k)


    Hi,

    I’m trying to figure out why the map markers specified in shortcodes are displaying in the wrong positions on the map. The shortcodes are being used within a DIVI code module, and no custom CSS is applied.

    Here are the default settings for Leaflet Map:

    Default Latitude: 47.1625
    Default Longitude: 19.5033
    Default Zoom: 8
    Default Height: 250
    Default Width: 100%
    Default Min Zoom: 0
    Default Max Zoom: 19
    Default Tiling Service: I will provide my own map URL
    Map Tile URL: https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png
    Map Tile URL Subdomains: abc
    JavaScript URL: https://unpkg.com/[email protected]/dist/leaflet.js
    CSS URL: https://unpkg.com/[email protected]/dist/leaflet.css
    Default Attribution: Leaflet; © OpenStreetMap contributors
    Geocoder: OpenStreetMap Nominatim
    KML/GPX JavaScript Converter: https://unpkg.com/@mapbox/[email protected]/togeojson.js


    Here are the shortcodes I am using:
    [leaflet-map scrollwheel=true dragging=true zoom=7 lat=47.1625 lon=19.5033]
    [leaflet-marker lat=47.497913 lon=19.040236]Budapest[/leaflet-marker]


    When the map loads for the first time, it correctly centers on Hungary (based on the provided coordinates: lat=47.1625 lon=19.5033). However, the markers always display in the wrong positions. For some reason, all markers appear in France.

    I also tried using older versions of the plugin, but the issue persists.

    Could you please help me understand what might be causing this and how to fix it?

    Thank you!
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor hupe13

    (@hupe13)

    You have a typo (lon -> lng):

    [leaflet-map scrollwheel=true dragging=true zoom=7 lat=47.1625 lng=19.5033]
    [leaflet-marker lat=47.497913 lng=19.040236]Budapest[/leaflet-marker]
    Thread Starter smokey2k

    (@smokey2k)

    omg I cant beleieve it, I asked chatgpt why the plugin display the markers at wrong position, turned out the cooridantes was wrong at the 1st time but the gpt told me I should use lon instead of lng because the new updates (wtf .. halucination …) …..
    A lesson learned 😀
    Thank you for your answer !

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Leaflet Map Markers Displaying Incorrectly’ is closed to new replies.