Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
gmap
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
drupal.org
gmap
Commits
2ec9c1bf
Commit
2ec9c1bf
authored
13 years ago
by
haiiro.shimeji
Browse files
Options
Downloads
Patches
Plain Diff
Info windows are still using all the old V1 methods,
parent
6665f8ba
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
js/marker.js
+19
-4
19 additions, 4 deletions
js/marker.js
with
19 additions
and
4 deletions
js/marker.js
+
19
−
4
View file @
2ec9c1bf
...
...
@@ -10,6 +10,8 @@
Drupal
.
gmap
.
addHandler
(
'
gmap
'
,
function
(
elem
)
{
var
obj
=
this
;
var
infowindow
=
null
;
obj
.
bind
(
'
init
'
,
function
()
{
if
(
obj
.
vars
.
behavior
.
autozoom
)
{
obj
.
bounds
=
new
google
.
maps
.
LatLngBounds
();
...
...
@@ -51,7 +53,7 @@ Drupal.gmap.addHandler('gmap', function (elem) {
obj
.
deferChange
(
'
clickmarker
'
,
-
1
,
marker
);
}
if
(
obj
.
vars
.
behavior
.
autozoom
)
{
obj
.
bounds
.
extend
(
marker
.
marker
.
getPoint
(
));
obj
.
bounds
.
extend
(
new
google
.
maps
.
LatLng
(
marker
.
latitude
,
marker
.
longitude
));
}
// If the highlight arg option is used in views highlight the marker.
if
(
marker
.
opts
.
highlight
==
1
)
{
...
...
@@ -61,9 +63,15 @@ Drupal.gmap.addHandler('gmap', function (elem) {
// Default marker actions.
obj
.
bind
(
'
clickmarker
'
,
function
(
marker
)
{
// Local/stored content
// Close infowindow if open to prevent multiple windows
if
(
infowindow
!=
null
){
infowindow
.
close
();
}
infowindow
=
new
google
.
maps
.
InfoWindow
({
content
:
marker
.
text
});
if
(
marker
.
text
)
{
marker
.
marker
.
openI
nfo
W
indow
Html
(
marker
.
text
);
i
nfo
w
indow
.
open
(
obj
.
map
,
marker
.
marker
);
}
// Info Window Query / Info Window Offset
if
(
marker
.
iwq
||
(
obj
.
vars
.
iwq
&&
typeof
marker
.
iwo
!=
'
undefined
'
))
{
...
...
@@ -123,7 +131,14 @@ Drupal.gmap.addHandler('gmap', function (elem) {
// If we are autozooming, set the map center at this time.
if
(
obj
.
vars
.
behavior
.
autozoom
)
{
if
(
!
obj
.
bounds
.
isEmpty
())
{
obj
.
map
.
setCenter
(
obj
.
bounds
.
getCenter
(),
Math
.
min
(
obj
.
map
.
getBoundsZoomLevel
(
obj
.
bounds
),
obj
.
vars
.
maxzoom
));
obj
.
map
.
fitBounds
(
obj
.
bounds
);
var
listener
=
google
.
maps
.
event
.
addListener
(
obj
.
map
,
"
idle
"
,
function
()
{
if
(
obj
.
vars
.
maxzoom
)
{
var
maxzoom
=
parseInt
(
obj
.
vars
.
maxzoom
)
if
(
obj
.
map
.
getZoom
()
>
maxzoom
)
obj
.
map
.
setZoom
(
maxzoom
);
google
.
maps
.
event
.
removeListener
(
listener
);
}
});
}
}
});
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment