hydrones
Forum Replies Created
-
Forum: Plugins
In reply to: [Leaflet Map] Markers are not visibleDear bozdoz,
Thanks to your 2.7.2 release I have no problems anymore! Thanks a lot for your plugin, and thank you so much for your help today.
Forum: Plugins
In reply to: [Leaflet Map] Markers are not visibleAnother information: it seems that there is a conflict between Leaflet plugin and wp-d3 js plugin. I made a test: when wp-d3 js is desactivated, there is no problem to display the marker on the map with Leaflet.
Actually I use both of them on my web page: Leaflet to show a map with the location of measurements, and wp-d3 js to plot the measurements.Forum: Plugins
In reply to: [Leaflet Map] Markers are not visibleWell, I still get the same SyntaxError: Unexpected token ‘<‘ still at the same line as before, and then my marker do not appear on the map. Any idea?
Forum: Plugins
In reply to: [Leaflet Map] Markers are not visibleHi bozdoz,
It’s my turn now to apologize, I just saw your answer.
Basically I wanted to had a leaflet marker to my map but it did not work.
When I had [leaflet-marker lat=44.67 lng=-63.61] after [leaflet-map lat=44.652535694663875 lng=-0.34855842590332037 zoom=14]
I get SyntaxError: Unexpected token ‘<‘.Hereafter what is in the console, the message error focus the line with the “*”:
<div id=”leaflet-wordpress-map-1″ class=”leaflet-wordpress-map” style=”height:350px; width:100%;”></div><p><script>
WPLeafletMapPlugin.add(function () {
var baseUrl = ‘https://stamen-tiles-{s}.a.ssl.fastly.net/toner-lite/{z}/{x}/{y}.png’,
base = (!baseUrl && window.MQ) ? MQ.mapLayer() : L.tileLayer(baseUrl, {
subdomains: ‘abcd’
}),
options = L.Util.extend({}, {
maxZoom: 20,
minZoom: 0,
layers: [base],
zoomControl: 1,
scrollWheelZoom: 0,
attributionControl: false
}, {}),
map = L.map(‘leaflet-wordpress-map-1’, options).setView([44.841680, -0.566745], 7);
WPLeafletMapPlugin.maps.push(map);
}); // end add
</script><br />
<script>
WPLeafletMapPlugin.add(function () {
var map_count = 1,
draggable = false,
marker = L.marker([44.67, -63.61], { draggable : draggable }),
previous_map = WPLeafletMapPlugin.maps[ map_count – 1 ],
is_image = previous_map.is_image_map,
image_len = WPLeafletMapPlugin.images.length,
previous_image = WPLeafletMapPlugin.images[ image_len – 1 ],
*previous_image_onload;</p><p>* if (draggable) {
marker.on(‘dragend’, function () {
var latlng = this.getLatLng(),
lat = latlng.lat,
lng = latlng.lng;
if (is_image) {
console.log(‘leaflet-marker y=’ + lat + ‘ x=’ + lng);
} else {
console.log(‘leaflet-marker lat=’ + lat + ‘ lng=’ + lng);
}
});
}</p><p> marker.addTo( previous_map );</p><p> WPLeafletMapPlugin.markers.push( marker );
}); // end add function
</script></section>
</div>I am updating the plugin and keep you informed immediately, thanks!