• The marker is position in the middle of the ocean while the lat and lng parameter are corrects:
    https://www.google.com/maps/place/22%C2%B054’39.7%22S+43%C2%B012’33.7%22W/@-22.9110137,-43.2115614,17z/data=!3m1!4b1!4m5!3m4!1s0x0:0xb29731e9fb3ae0f1!8m2!3d-22.9110137!4d-43.2093727

    Generated shortcode:

    [leaflet-map zoom=4 lat=-22.91101370 lng=-43.20937270  maxbounds=-22.91101370,-43.20937270 detect-retina zoomcontrol dragging  !scrollwheel !attribution !touchZoom !keyboard  tileurl='https://stamen-tiles-{s}.a.ssl.fastly.net/watercolor/{z}/{x}/{y}.jpg']
    
    [leaflet-marker title='Boulders Beach' iconUrl='/wp-content/uploads/markers/epicside_icon_location_frontcolor_backwhite_framed_marker.svg' iconclass='marker_icon' iconSize='45.55,50' iconAnchor='21.195,50' shadowUrl='/wp-content/uploads/markers/epicside_icon_location_frontcolor_backwhite_framed_marker_shadow.svg' shadowSize='120.36,33.84' shadowanchor='10.466,33.536' maxWidth='150']Boulders Beach[/leaflet-marker]
    
    [leaflet-marker title='Afrique du Sud' lat=-28.81662360 lng=24.99163900 iconUrl='/wp-content/uploads/flags/za.svg' iconSize='50,34' iconAnchor='25,17']Afrique du Sud[/leaflet-marker]
    • This topic was modified 1 year, 10 months ago by matbe81. Reason: Wrong link initialy provided

    The page I need help with: [log in to see the link]

Viewing 15 replies - 16 through 30 (of 41 total)
  • Thread Starter matbe81

    (@matbe81)

    It look the break occurs when upgrading Leaflet Map WordPress plugin from version 3.0.2 to 3.1.0 since my test environment don’t have any issue using the same source code for map generation:

    https://test.epicside.be/experience/observer-les-manchots-a-boulders-beach/

    https://test.epicside.be/experience/rallier-le-pain-de-sucre-en-telepherique/

    Any idea?

    • This reply was modified 1 year, 10 months ago by matbe81.
    Thread Starter matbe81

    (@matbe81)

    I confirm having restored version 3.0.2 of leaflet-map wordpress plugin in place of 3.1.0 on the prod env and everything is back OK.

    Issue can still be seen on the dev env. Same url except domain https://dev.epicside.co in place of https://epicside.co

    Any idea?

    • This reply was modified 1 year, 10 months ago by matbe81.
    Plugin Contributor hupe13

    (@hupe13)

    Did you add some custom code?

    Thread Starter matbe81

    (@matbe81)

    Don’t think so. The code was written 2 years ago and never changed. I have made all the updated since that without any issue. Look that only 3.1.0 make issues.

    Plugin Contributor hupe13

    (@hupe13)

    I ask because I have never seen such a code before in the html sources, not in the old versions either:

    var marker_options = (function () {
        var _options = {
        ...
        var default_icon = L.Icon.Default.prototype.options;
        if (_options.iconUrl) {...
            ...
        }
        return _options;
    ....

    Please update the leafletjs urls.

    Thread Starter matbe81

    (@matbe81)

    I have replicated the prod env to the dev env then have updated the leaflet map plugin to the latest version (3.1.0) on the dev env and and have updated the URL in the leaflet map settings page of the dev env to 1.9.2.

    Thanks for having a look.

    Plugin Contributor hupe13

    (@hupe13)

    The content of https://dev.epicside.co/destination/australia/ and https://epicside.co/destination/australia/ is the same? The map is missing on the development page.

    Thread Starter matbe81

    (@matbe81)

    Indeed. Look another side effect of the plugin update.

    Let’s first concentrate on the map present on those pages:
    https://epicside.be/experience/observer-les-manchots-a-boulders-beach/
    https://dev.epicside.be/experience/observer-les-manchots-a-boulders-beach/

    • This reply was modified 1 year, 10 months ago by matbe81.
    Plugin Contributor hupe13

    (@hupe13)

    You must have a custom code. I don’t find the string from html code var marker_options = (function () { in the sources of Leaflet Map.

    Your shortcode seems to be:

    [leaflet-map lat=... lng=... zoom=... ...]  //with lat and lng
    [leaflet-marker ...]   //without lat and lng

    Can you write (or create) the shortcode like:

    [leaflet-map ... fitbounds]  //without lat and lng
    [leaflet-marker lat=... lng=... ...]   //with lat and lng

    or

    [leaflet-map lat=... lng=... zoom=... ...]  //with lat and lng
    [leaflet-marker lat=... lng=... ...]   //with lat and lng
    • This reply was modified 1 year, 10 months ago by hupe13.
    • This reply was modified 1 year, 10 months ago by hupe13.
    Plugin Contributor hupe13

    (@hupe13)

    Thread Starter matbe81

    (@matbe81)

    Thank you! But isn’t possible to set that directly in PHP for cleaner integration?

    Please note I don’t want to use fitbounds on map layer as I want the experience (boulder beach in the example is always centered.

    So I added lat & lng to the experience marker and only require to fix the maxBound setting:

    // Map
    echo do_shortcode("[leaflet-map lat=". $experience_current['lat']." lng=". $experience_current['lng'] . " zoom=".$experience_current['map_zoom']." detect-retina zoomcontrol dragging !scrollwheel !attribution !touchZoom !keyboard tileurl='https://stamen-tiles-{s}.a.ssl.fastly.net/watercolor/{z}/{x}/{y}.jpg']");
    
    // Experience Marker
    echo do_shortcode("[leaflet-marker lat=". $experience_current['lat']." lng=". $experience_current['lng'] . " title='".$experience_current['location']."' iconUrl='".$site['markers']['normal']."' iconclass='marker_icon' iconSize='".$site['marker']['icon_size']."' iconAnchor='".$site['marker']['icon_anchor']."' shadowUrl='".$site['markers']['shadow']."' shadowSize='".$site['marker']['shadow_size']."' shadowanchor='".$site['marker']['shadow_anchor']."' maxWidth='150']".$experience_current['location']."[/leaflet-marker]");

    Play attention to ‘maxbounds=”. $experience_current[‘lat’].”,”. $experience_current[‘lng’]’.

    How should i adapt it to have the correct calculation? It looks to be the only issue as when I completely remove it, the marker are well positioned.

    https://dev.epicside.co/experience/observer-les-manchots-a-boulders-beach/

    But for your consideration, the incorrect maxBounds setting was present for years so since version 3.1.0, something changes.

    Thank you again.

    Plugin Contributor hupe13

    (@hupe13)

    @bozdoz: can you help please? A map with lan, lng, zoom, maxbounds and a marker without lat and lng do not work together. I suspect it is a bug. I have an example. The same effect is in version 3.0.5, I tested it. Thank you.

    Plugin Contributor hupe13

    (@hupe13)

    Please note I don’t want to use fitbounds on map layer as I want the experience (boulder beach in the example is always centered.

    You can use lat, lng and zoom. The important thing is the state when the map is “ready”.

    Thread Starter matbe81

    (@matbe81)

    As i use wordpress shortcodes, i think it’s automatically send when map is in “ready” state.

    Please keep me in touch on the bug resolution which didn’t affect version 3.0.2

    Plugin Contributor hupe13

    (@hupe13)

    It is not a bug, it is a feature. If maxbounds is used, leaflet-marker without lan and lng are in the center of maxbounds. @bozdoz, should that be so?

Viewing 15 replies - 16 through 30 (of 41 total)
  • The topic ‘Marker position not matching provided lat & lng’ is closed to new replies.