Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Pixel Humain
api
Commits
dd8ac199
Commit
dd8ac199
authored
Mar 03, 2020
by
Raph El
Browse files
Modif
parent
5d49bab4
Changes
1
Hide whitespace changes
Inline
Side-by-side
assets/js/sig/map.js
View file @
dd8ac199
...
...
@@ -47,7 +47,7 @@
//créé une donnée GeoJson (pour les cluster)
this
.
Sig
.
getGeoJsonMarker
=
function
(
properties
/*json*/
,
coordinates
/*array[lat, lng]*/
)
{
//
console
.warn("--------------- getGeoJsonMarker ---------------------");
//
mylog
.warn("--------------- getGeoJsonMarker ---------------------");
properties
.
visible
=
false
;
//alert(JSON.stringify(properties));
return
{
"
type
"
:
'
Feature
'
,
...
...
@@ -61,7 +61,7 @@
//créé un objet L.Marker (sans cluster)
this
.
Sig
.
getMarkerSingle
=
function
(
thisMap
,
options
,
coordinates
)
{
//
console
.warn("--------------- getMarkerSingle ---------------------");
//
mylog
.warn("--------------- getMarkerSingle ---------------------");
var
thisSig
=
this
;
var
contentString
=
options
.
content
;
if
(
options
.
content
==
null
)
contentString
=
""
;
...
...
@@ -129,7 +129,7 @@
//récupère le nom de l'icon en fonction du type de marker souhaité
this
.
Sig
.
getIcoMarkerMap
=
function
(
thisData
)
{
//
console
.warn("--------------- getIcoMarker *** ---------------------");
//
mylog
.warn("--------------- getIcoMarker *** ---------------------");
if
(
typeof
thisData
.
author
!=
"
undefined
"
)
thisData
=
thisData
.
author
;
...
...
@@ -150,7 +150,7 @@
this
.
Sig
.
getIcoMarker
=
function
(
thisData
)
{
//
console
.warn("--------------- getIcoMarker ---------------------");
//
mylog
.warn("--------------- getIcoMarker ---------------------");
var
ico
=
this
.
getIcoNameByType
(
thisData
);
var
color
=
this
.
getIcoColorByType
(
thisData
);
...
...
@@ -164,7 +164,7 @@
{
if
(
typeof
showMe
==
"
undefined
"
)
showMe
=
true
;
console
.
warn
(
"
--------------- clearMap ---------------------
"
);
mylog
.
warn
(
"
--------------- clearMap ---------------------
"
);
if
(
this
.
markersLayer
!=
""
)
this
.
markersLayer
.
clearLayers
();
...
...
@@ -217,7 +217,7 @@
var
thisSig
=
this
;
if
(
thisSig
.
myPosition
!=
null
){
//
console
.dir(thisSig.myPosition);
//
mylog
.dir(thisSig.myPosition);
var
center
=
[
thisSig
.
myPosition
.
position
.
latitude
,
thisSig
.
myPosition
.
position
.
longitude
];
...
...
@@ -254,7 +254,7 @@
//gère les dimensions des différentes parties de la carte (carte, panel, etc) en mode full screen
this
.
Sig
.
setFullScreen
=
function
()
{
////
console
.warn("--------------- setFullScreen ---------------------");
////
mylog
.warn("--------------- setFullScreen ---------------------");
//full screen map
var
mapHeight
=
$
(
"
.subviews.subviews-top
"
).
height
();
// - $(".toolbar").height();
var
rightListHeight
=
mapHeight
-
110
;
...
...
@@ -325,7 +325,7 @@
}
this
.
Sig
.
verifyPanelFilter
=
function
(
thisData
){
//
console
.warn("--------------- verifyPanelFilter ---------------------");
//
mylog
.warn("--------------- verifyPanelFilter ---------------------");
if
(
this
.
panelFilter
==
"
all
"
)
return
true
;
...
...
@@ -400,7 +400,7 @@
this
.
Sig
.
showPolygon
=
function
(
polygonPoints
,
options
)
{
//
console
.dir(polygonPoints);
//
mylog
.dir(polygonPoints);
//si le polygone existe déjà on le supprime
if
(
this
.
mapPolygon
!=
null
)
this
.
map
.
removeLayer
(
this
.
mapPolygon
);
//puis on charge le nouveau polygone
...
...
@@ -423,14 +423,14 @@
inversedPoly
.
push
(
new
Array
(
lng
,
lat
));
});
}
console
.
dir
(
inversedPoly
);
mylog
.
dir
(
inversedPoly
);
return
inversedPoly
;
};
this
.
Sig
.
getCoordinates
=
function
(
thisData
,
type
)
{
//
console
.warn("--------------- getCoordinates ---------------------");
//
console
.dir(thisData);
//
mylog
.warn("--------------- getCoordinates ---------------------");
//
mylog
.dir(thisData);
//si la donnée est une news, on doit afficher la position de l'auteur
if
(
typeof
thisData
.
typeSig
!==
"
undefined
"
){
if
(
thisData
.
typeSig
==
"
news
"
&&
typeof
thisData
.
author
!==
"
undefined
"
){
...
...
@@ -455,13 +455,13 @@
}
else
if
(
typeof
thisData
.
geometry
!=
"
undefined
"
){
//resultat search street on google map
console
.
dir
(
thisData
);
//mylog
.dir(thisData);
if
(
type
==
"
markerSingle
"
){
if
(
typeof
thisData
.
geometry
.
location
!=
"
undefined
"
){
var
lat
=
thisData
.
geometry
.
location
.
lat
;
var
lng
=
thisData
.
geometry
.
location
.
lng
;
console
.
dir
(
new
Array
(
lat
,
lng
));
//mylog
.dir(new Array (lat, lng));
return
new
Array
(
lat
,
lng
);
}
}
else
if
(
type
==
"
markerGeoJson
"
){
...
...
@@ -479,8 +479,8 @@
this
.
Sig
.
showOneElementOnMap
=
function
(
thisData
,
thisMap
){
//
console
.warn("--------------- showOneElementOnMap ---------------------");
//
console
.dir(thisData);
//
mylog
.warn("--------------- showOneElementOnMap ---------------------");
//
mylog
.dir(thisData);
//var objectId = thisData._id ? thisData._id.$id.toString() : null;
var
objectId
=
this
.
getObjectId
(
thisData
);
...
...
@@ -529,7 +529,7 @@
if
(
thisData
[
"
type
"
]
==
"
city
"
){
//
console
.dir(thisData);
//
mylog
.dir(thisData);
if
(
typeof
thisData
[
"
geoShape
"
]
!=
"
undefined
"
&&
typeof
thisData
[
"
geoShape
"
][
"
coordinates
"
]
!=
"
undefined
"
){
var
geoShape
=
Sig
.
inversePolygon
(
thisData
[
"
geoShape
"
][
"
coordinates
"
][
0
]);
...
...
@@ -563,7 +563,7 @@
this
.
createItemRigthListMap
(
thisData
);
$
(
this
.
cssModuleName
+
"
.item_map_list_
"
+
objectId
).
click
(
function
(){
//toastr.success('click on element not in map');
//
console
.dir(thisData);
//
mylog
.dir(thisData);
thisSig
.
showModalItemNotLocated
(
thisData
);
});
}
...
...
@@ -587,11 +587,11 @@
}
else
{
if
(
thisData
==
null
)
return
false
;
//
console
.warn("--------------- PAS D'ID ---------------------");
//
console
.dir(thisData);
//
mylog
.warn("--------------- PAS D'ID ---------------------");
//
mylog
.dir(thisData);
if
(
"
undefined
"
!=
typeof
thisData
[
"
chartOptions
"
]){
//
console
.warn("--------------- LOAD CHART ---------------------");
//
mylog
.warn("--------------- LOAD CHART ---------------------");
this
.
addChart
(
thisData
)
}
return
false
;
...
...
@@ -601,14 +601,14 @@
};
this
.
Sig
.
showFilterOnMap
=
function
(
data
,
thisFilter
,
thisMap
){
//
console
.warn("--------------- showFilterOnMap ***%%% ---------------------");
//
mylog
.warn("--------------- showFilterOnMap ***%%% ---------------------");
var
thisSig
=
this
;
var
dataFilter
=
(
data
!=
null
)
?
data
[
thisFilter
]
:
thisFilter
;
//alert(JSON.stringify(dataFilter));
if
(
$
.
isArray
(
dataFilter
)){
$
.
each
(
dataFilter
,
function
(
i
,
thisData
)
{
////
console
.warn("--------------- show each thisData ---------------------");
////
console
.dir(thisData);
////
mylog
.warn("--------------- show each thisData ---------------------");
////
mylog
.dir(thisData);
thisSig
.
showOneElementOnMap
(
thisData
,
thisMap
);
});
}
...
...
@@ -620,7 +620,7 @@
this
.
Sig
.
showMapElements
=
function
(
thisMap
,
data
)
{
console
.
warn
(
"
--------------- showMapElements ---------------------
"
);
mylog
.
warn
(
"
--------------- showMapElements ---------------------
"
);
if
(
data
==
null
)
return
;
...
...
@@ -723,7 +723,7 @@
}
});
////
console
.warn("--------------- showMapElements onEachFeature OK ---------------------");
////
mylog
.warn("--------------- showMapElements onEachFeature OK ---------------------");
this
.
markersLayer
.
addLayer
(
points
);
// add it to the cluster group
thisMap
.
addLayer
(
this
.
markersLayer
);
// add it to the map
...
...
@@ -737,7 +737,7 @@
this
.
checkListElementMap
(
thisMap
);
//
console
.dir(this.markersLayer.getBounds());
//
mylog
.dir(this.markersLayer.getBounds());
if
(
"
undefined
"
!=
typeof
this
.
markersLayer
.
getBounds
()
&&
"
undefined
"
!=
typeof
this
.
markersLayer
.
getBounds
().
_northEast
){
thisMap
.
fitBounds
(
this
.
markersLayer
.
getBounds
(),
{
'
maxZoom
'
:
10
});
...
...
@@ -771,7 +771,7 @@
this
.
Sig
.
loadMap
=
function
(
canvasId
,
initParams
)
{
console
.
warn
(
"
--------------- loadMap ---------------------
"
);
mylog
.
warn
(
"
--------------- loadMap ---------------------
"
);
canvasId
+=
initParams
.
sigKey
;
if
(
this
.
map
==
null
){
$
(
"
#
"
+
canvasId
).
html
(
""
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment