• 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 11 replies - 31 through 41 (of 41 total)
  • Plugin Author bozdoz

    (@bozdoz)

    I don’t understand this thread. As far as I can tell, yes, it is working. If you place a marker without an address or a lat/lng, then it appears at the center of the map. Sorry for the delay. I was never clear about what this issue was.

    Plugin Contributor hupe13

    (@hupe13)

    If you place a marker without an address or a lat/lng, then it appears at the center of the map.

    This confirms what I wrote. This was not clear to me before.

    Thread Starter matbe81

    (@matbe81)

    OK and it work fine include version 3.0.2 but not anymore in version 3.1.0 using same code.

    Plugin Contributor hupe13

    (@hupe13)

    There is no difference on my test page between Leaflet Map 3.1.0 and 3.0.2.

    Which shortcode you are using? Where are the markers and where should they be? Please test it with 3.1.0.

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

    (@matbe81)

    No difference in shortcode generator :

    <?php
    global $site, $experience_current;
    
    if (isset($experience_current['lat']) && !empty($experience_current['lat']) &&
    	 (isset($experience_current['lng']) && !empty($experience_current['lng'])
    	 )){
       
    echo do_shortcode("[leaflet-map zoom=".$experience_current['map_zoom']." lat=". $experience_current['lat']." lng=". $experience_current['lng']." maxbounds=". $experience_current['lat'].",". $experience_current['lng']." 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 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]");
    
    	//		$code_markers .= "[leaflet-marker title='".$experience_value["location"].", ".$experience_value["country_fr"]."' lat=". $experience_value["lat"]." lng=". $experience_value["lng"]." iconUrl='/wp-content/uploads/logos/epicside_icon_location_frontcolor_backwhite_framed_marker.svg' iconclass='marker_icon' iconSize='45.55,50' iconAnchor='20.46,48.293' shadowUrl='/wp-content/uploads/logos/epicside_icon_location_frontcolor_backwhite_framed_marker_shadow.svg' shadowSize='122.03,35.47' shadowanchor='11.891,34.521' maxWidth='150']<a href='".$link."' target='_blank'>".$image."<div class='leaflet-marker-titlecontainer'>".$title.$subtitle."</div>"."</a>"."[/leaflet-marker]";
    	
    // Country marker
    $flag_url = $site["base_flags"].$experience_current['country_code'].".svg";
    echo do_shortcode("[leaflet-marker title='".$experience_current['country_fr']."' lat=". $experience_current['country_lat']." lng=". $experience_current['country_lng']." iconUrl='".$flag_url."' iconSize='".$site['marker']['flag_size']."' iconAnchor='".$site['marker']['flag_anchor']."']".$experience_current['country_fr']."[/leaflet-marker]");
    
    // Parent Country marker
    	if (!empty($experience_current['parent_country_code']) && !empty($experience_current['parent_country_lat']) && !empty($experience_current['parent_country_lng'])){
    		$flag_url = $site["base_flags"].$experience_current['parent_country_code'].".svg";
    		echo do_shortcode("[leaflet-marker title='".$experience_current['parent_country_fr']."' lat=". $experience_current['parent_country_lat']." lng=". $experience_current['parent_country_lng']." iconUrl='".$flag_url."' iconSize='".$site['marker']['flag_size']."' iconAnchor='".$site['marker']['flag_anchor']."']".$experience_current['parent_country_fr']."[/leaflet-marker]");
    	}
    }
    ?>

    Only differerence is version:

    Prod env (3.0.2):
    https://epicside.be/experience/observer-les-manchots-a-boulders-beach/

    Dev env (3.1.0):
    https://dev.epicside.be/experience/observer-les-manchots-a-boulders-beach/

    As you can see, position of the map is totally wrong on dev env. So something definitely changes between those 2 versions.

    Plugin Contributor hupe13

    (@hupe13)

    maxbounds=". $experience_current['lat'].",". $experience_current['lng']."

    php result:

    maxBounds=-34.19804835,18.45235249

    This is false. As I wrote here, you should define two opposite corners.

    maxbounds="-22.594,14.370;-34.922,33.135" or similar.

    The Leaflet Map generates in version 3.1.0 "maxBounds":[["-34.19804835","18.45235249"],["",""]]" and in version 3.0.2 "maxBounds": [["-34.19804835","18.45235249"],[null,null]]" and this is interpreted differently.

    Plugin Contributor hupe13

    (@hupe13)

    Have you tested this?

    Thread Starter matbe81

    (@matbe81)

    I changed it to that:

    echo do_shortcode(“[leaflet-map zoom=”.$experience_current[‘map_zoom’].” lat=”. $experience_current[‘lat’].” lng=”. $experience_current[‘lng’].” maxbounds=”. $experience_current[‘lat’].”,”. $experience_current[‘lng’].”;”.$experience_current[‘lat’].”,”. $experience_current[‘lng’].” detect-retina zoomcontrol dragging !scrollwheel !attribution !touchZoom !keyboard tileurl=’https://stamen-tiles-{s}.a.ssl.fastly.net/watercolor/{z}/{x}/{y}.jpg’]”);

    Seems better. WDYT?

    Thread Starter matbe81

    (@matbe81)

    Something else: same issue on version difference on this page:
    Prod (3.0.2):
    https://epicside.be/destination/australia/

    Dev (3.1.0):
    https://dev.epicside.be/destination/australia/

    The map simply don’t appears at all in dev.

    Code is the same:

    global $site, $destination_current, $page_current;
    //e($destination_current);
    
    if ($page_current['type'] == "destination") {
    
    	if (isset($destination_current['lat']) && !empty($destination_current['lat']) &&
    		 (isset($destination_current['lng']) && !empty($destination_current['lng'])
    		 )){
    
    	echo do_shortcode("[leaflet-map zoom=".$destination_current['map_zoom']." lat=". $destination_current['lat']." lng=". $destination_current['lng']." maxbounds=". $destination_current['lat'].",". $destination_current['lng'].";".$destination_current['lat'].",". $destination_current['lng']." detect-retina zoomcontrol dragging !scrollwheel !attribution !touchZoom !keyboard tileurl='https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png' subdomains='abc']");
    
    	// Destination Marker
    	echo do_shortcode("[leaflet-marker fitbounds title='".$destination_current['name_fr']."' iconUrl='".$site['markers']['full']."' iconclass='marker_icon' iconSize='".$site['marker']['icon_size']."' lat=". $destination_current['lat']." lng=". $destination_current['lng']." iconAnchor='".$site['marker']['icon_anchor']."' shadowUrl='".$site['markers']['shadow']."' shadowSize='".$site['marker']['shadow_size']."' shadowanchor='".$site['marker']['shadow_anchor']."' maxWidth='150']".$destination_current['name_fr']."[/leaflet-marker]");
    
    			//	$code_markers .= "[leaflet-marker fitbounds title='".$country_fr.(!empty($parent_fr)?", ".$parent_fr:"").chr(13).$country_local.(!empty($parent_local)?", ".$parent_local:"")."' lat=". $lat." lng=". $lng." iconUrl='/wp-content/uploads/logos/epicside_icon_location_frontwhite_backcolor_nonframed_square_marker.svg' iconclass='marker_icon' iconSize='45.55,50' iconAnchor='20.46,48.293' shadowUrl='/wp-content/uploads/logos/epicside_icon_location_frontcolor_backwhite_framed_marker_shadow.svg' shadowSize='122.03,35.47' shadowanchor='11.891,34.521' maxWidth='150']".($has_link?"<a href='".$link."' target='_blank'>":"").$mainflag."<div class='leaflet-marker-titlecontainer'>".$title.$subtitle."</div>".($has_link?"</a>":"")."[/leaflet-marker]";
    
    echo do_shortcode("[leaflet-geojson src='/countries.json?country=".$destination_current['code']."']");
    
    	
    	// Country marker
    	$flag_url = $site["base_flags"].$destination_current['code'].".svg";
    	//echo do_shortcode("[leaflet-marker title='".$destination_current['name_fr']."' lat=". $destination_current['country_lat']." lng=". $destination_current['country_lng']." iconUrl='".$flag_url."' iconSize='".$site['marker']['flag_size']."' iconAnchor='".$site['marker']['flag_anchor']."']".$destination_current['name_fr']."[/leaflet-marker]");
    
    	// Parent Country marker
    		if (!empty($destination_current['parent_country_code']) && !empty($destination_current['parent_country_lat']) && !empty($destination_current['parent_country_lng'])){
    			$flag_url = $site["base_flags"].$destination_current['parent_country_code'].".svg";
    			echo do_shortcode("[leaflet-marker title='".$destination_current['parent_country_fr']."' lat=". $destination_current['parent_country_lat']." lng=". $destination_current['parent_country_lng']." iconUrl='".$flag_url."' iconSize='".$site['marker']['flag_size']."' iconAnchor='".$site['marker']['flag_anchor']."']".$destination_current['parent_country_fr']."[/leaflet-marker]");
    		}
    	}
    	
    }
    ?>
    Plugin Contributor hupe13

    (@hupe13)

    maxbounds=”. $experience_current[‘lat’].”,”. $experience_current[‘lng’].”;”.$experience_current[‘lat’].”,”. $experience_current[‘lng’].”

    These are not two corners! But it works.

    Plugin Contributor hupe13

    (@hupe13)

    The map simply don’t appears at all in dev.

    I don’t see that you have entered any leaflet shortcode.

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