Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
aa.gusti
/
opensipkd-base
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit d9c1f73a
authored
Jan 23, 2025
by
aa.gusti
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
perbaikan gmap.js
1 parent
55d83873
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
12 deletions
opensipkd/base/static/js/gmap.js
opensipkd/base/static/js/gmap.js
View file @
d9c1f73
...
...
@@ -40,17 +40,17 @@ function initMap() {
map
.
data
.
setControls
(
gmapControls
);
google
.
maps
.
event
.
addListener
(
map
,
"center_changed"
,
function
(
e
)
{
latLngObj
=
map
.
getCenter
();
console
.
log
(
"lat long object "
+
latLngObj
);
console
.
log
(
e
);
});
//
google.maps.event.addListener(map, "center_changed", function (e) {
//
latLngObj = map.getCenter();
//
console.log("lat long object " + latLngObj);
//
console.log(e);
//
});
google
.
maps
.
event
.
addListener
(
map
.
data
,
"center_changed"
,
function
(
e
)
{
latLngObj
=
map
.
data
.
getCenter
();
console
.
log
(
"lat long object data "
+
latLngObj
);
console
.
log
(
e
);
});
//
google.maps.event.addListener(map.data, "center_changed", function (e) {
//
latLngObj = map.data.getCenter();
//
console.log("lat long object data " + latLngObj);
//
console.log(e);
//
});
google
.
maps
.
event
.
addListener
(
map
.
data
,
"addfeature"
,
function
(
e
)
{
if
(
map
.
data
.
map
.
data
.
getControls
()
!==
null
)
{
...
...
@@ -62,7 +62,9 @@ function initMap() {
selectedFeature
=
e
.
feature
;
btnRemove
.
disabled
=
false
;
map
.
setCenter
(
center
);
// map.setZoom(18);
// console.log("lat long object " + center);
map
.
panTo
(
center
);
map
.
setZoom
(
18
);
}
else
{
let
bounds
=
new
google
.
maps
.
LatLngBounds
();
bounds
=
extendBound
(
bounds
,
e
.
feature
);
...
...
@@ -244,14 +246,16 @@ function getFeatureBounds() {
}
function
setControls
()
{
console
.
log
(
"setControl"
);
let
total
=
0
;
let
bounds
=
new
google
.
maps
.
LatLngBounds
();
map
.
data
.
forEach
(
function
(
e
)
{
total
++
;
bounds
=
extendBound
(
bounds
,
e
);
});
console
.
log
(
bounds
);
if
(
total
>
0
)
{
map
.
fitBounds
(
bounds
);
//
map.fitBounds(bounds);
map
.
data
.
setDrawingMode
(
null
);
map
.
data
.
setControls
(
null
);
let
zoomLevel
=
map
.
getZoom
();
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment