Commit 82cebbd9 authored by Raph El's avatar Raph El
Browse files

Hotfix

parent 63f6e00d
var mapObj = { var mapObj = {
container : 'mapContainer', container : 'mapContainer',
map : null, map : null,
...@@ -50,8 +51,9 @@ var mapObj = { ...@@ -50,8 +51,9 @@ var mapObj = {
if(mapObj.arrayBounds.length > 0){ if(mapObj.arrayBounds.length > 0){
mapObj.bounds = L.bounds(mapObj.arrayBounds); mapObj.bounds = L.bounds(mapObj.arrayBounds);
var point = mapObj.bounds.getCenter() var point = mapObj.bounds.getCenter();
//mapObj.map.panTo([point.x, point.y]); console.log("POINT", point);
mapObj.map.panTo([point.x, point.y]);
} }
if(mapObj.activeCluster === true) if(mapObj.activeCluster === true)
...@@ -85,16 +87,25 @@ var mapObj = { ...@@ -85,16 +87,25 @@ var mapObj = {
shadowAnchor: [22, 94], shadowAnchor: [22, 94],
}); });
console.log("addMarker myIcon", myIcon); console.log("addMarker myIcon", myIcon);
if(typeof params.opt == "undefined" || params.opt == null)
params.opt = {} ;
params.opt.icon = myIcon ; params.opt.icon = myIcon ;
console.log("addMarker myIcon end", myIcon);
var latLon = [ params.elt.geo.latitude, params.elt.geo.longitude ] ; var latLon = [ params.elt.geo.latitude, params.elt.geo.longitude ] ;
var marker = L.marker(latLon, params.opt ); var marker = L.marker(latLon, params.opt );
console.log("addMarker marker", marker);
mapObj.markerList.push(marker); mapObj.markerList.push(marker);
console.log("addMarker mapObj.markerList", mapObj.markerList);
if(typeof params.addPopUp != "undefined" && params.addPopUp === true) if(typeof params.addPopUp != "undefined" && params.addPopUp === true)
mapObj.addPopUp(marker, params.elt); mapObj.addPopUp(marker, params.elt);
mapObj.arrayBounds.push(latLon); mapObj.arrayBounds.push(latLon);
console.log("addMarker marker2", marker);
if(mapObj.activeCluster === true) if(mapObj.activeCluster === true)
mapObj.markersCluster.addLayer(marker); mapObj.markersCluster.addLayer(marker);
else{ else{
...@@ -102,8 +113,9 @@ var mapObj = { ...@@ -102,8 +113,9 @@ var mapObj = {
if(typeof params.center != "undefined" && params.center === true) if(typeof params.center != "undefined" && params.center === true)
mapObj.map.panTo(latLon); mapObj.map.panTo(latLon);
} }
} }
//console.log("addMarker end", marker); console.log("addMarker end", marker);
}, },
addPolygon: function(){ addPolygon: function(){
var polygon = L.polygon([ var polygon = L.polygon([
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment