Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
labelabeille
app
Commits
33817920
Commit
33817920
authored
Oct 12, 2016
by
wilhelmhb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update map
parent
ee6eef54
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
9 deletions
+6
-9
js/carte.js
js/carte.js
+6
-9
No files found.
js/carte.js
View file @
33817920
...
...
@@ -91,7 +91,8 @@ function initializeMap(hiveCoordinates) {
function
createMap
(
element
,
lat
,
long
,
zoom
)
{
map
=
new
google
.
maps
.
Map
(
element
,
{
'
zoom
'
:
zoom
,
'
center
'
:
new
google
.
maps
.
LatLng
(
lat
,
long
)
'
center
'
:
new
google
.
maps
.
LatLng
(
lat
,
long
),
'
mapTypeId
'
:
google
.
maps
.
MapTypeId
.
SATELLITE
});
};
...
...
@@ -100,26 +101,22 @@ function initializeMap(hiveCoordinates) {
*/
function
displayElements
()
{
createMap
(
document
.
getElementById
(
"
corps_carte
"
),
46.513202
,
2.381958
,
4
);
//console.log(map);
if
(
markers
!=
null
&&
markers
.
length
>
0
)
{
//console.log(markers);
for
(
var
k
=
0
;
k
<
markers
.
length
;
k
++
)
{
markers
[
k
].
setMap
(
null
);
delete
markers
[
k
];
}
}
else
{
alert
(
"
Aucune ruche à afficher
"
);
}
/* reset all constants of the map */
index
=
0
;
markers
=
new
Array
();
for
(
var
i
=
0
;
i
<
hiveCoordinates
.
length
;
i
++
)
{
//console.log(JSON.stringify(
hiveCoordinates
[i]))
;
if
(
hive
Coordinates
[
i
]
!=
null
&&
hive
Coordinates
[
i
].
lat
!=
null
&&
hiveCoordinates
[
i
].
lng
!=
null
&&
(
hiveCoordinates
[
i
].
lat
!=
'
0.0
0000000
'
||
hiveCoordinates
[
i
].
lng
!=
'
0.0
0000000
'
))
{
markers
[
index
]
=
createMarker
(
index
,
map
,
hive
Coordinates
[
i
].
lat
,
hiveCoordinates
[
i
].
lng
,
"
http://www.label-abeille.org/modules/cmaps/views/img/markers/yellow_pin.png
"
);
for
(
var
hive
in
hiveCoordinates
.
data
)
{
hive
=
hiveCoordinates
.
data
[
hive
]
;
if
(
hive
!=
null
&&
hive
.
LAT
!=
null
&&
hive
.
LNG
!=
null
&&
(
hive
.
LAT
.
v
!=
0.0
||
hive
.
LNG
.
v
!=
0.0
))
{
markers
[
index
]
=
createMarker
(
index
,
map
,
hive
.
LAT
.
v
,
hive
.
LNG
.
v
,
"
http://www.label-abeille.org/modules/cmaps/views/img/markers/yellow_pin.png
"
);
index
++
;
}
}
...
...
Write
Preview
Markdown
is supported
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