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
7592e0e0
Commit
7592e0e0
authored
19 years ago
by
webgeer
Browse files
Options
Downloads
Patches
Plain Diff
Add custom marker types
parent
b1cd3093
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
gmap.js
+46
-11
46 additions, 11 deletions
gmap.js
with
46 additions
and
11 deletions
gmap.js
+
46
−
11
View file @
7592e0e0
/* $Id$ */
var
baseIcon
;
var
baseIcon
=
new
Array
()
;
function
gmap_init
()
{
baseIcon
=
new
GIcon
();
baseIcon
.
image
=
"
http://www.google.com/mapfiles/marker.png
"
;
baseIcon
.
shadow
=
"
http://www.google.com/mapfiles/shadow50.png
"
;
baseIcon
.
iconSize
=
new
GSize
(
20
,
34
);
baseIcon
.
shadowSize
=
new
GSize
(
37
,
34
);
baseIcon
.
iconAnchor
=
new
GPoint
(
9
,
34
);
baseIcon
.
infoWindowAnchor
=
new
GPoint
(
9
,
2
);
baseIcon
.
infoShadowAnchor
=
new
GPoint
(
18
,
25
);
function
gmap_init
()
{
baseIcon
[
'
standard
'
]
=
new
GIcon
();
baseIcon
[
'
standard
'
].
image
=
"
http://www.google.com/mapfiles/marker.png
"
;
baseIcon
[
'
standard
'
].
shadow
=
"
http://www.google.com/mapfiles/shadow50.png
"
baseIcon
[
'
standard
'
].
iconSize
=
new
GSize
(
20
,
34
);
baseIcon
[
'
standard
'
].
shadowSize
=
new
GSize
(
37
,
34
);
baseIcon
[
'
standard
'
].
iconAnchor
=
new
GPoint
(
9
,
34
);
baseIcon
[
'
standard
'
].
infoWindowAnchor
=
new
GPoint
(
9
,
2
);
baseIcon
[
'
standard
'
].
infoShadowAnchor
=
new
GPoint
(
18
,
25
);
baseIcon
[
'
big
'
]
=
new
GIcon
();
baseIcon
[
'
big
'
].
image
=
'
modules/gmap/markers/big/blue.png
'
;
baseIcon
[
'
big
'
].
shadow
=
'
modules/gmap/markers/big/shadow.png
'
;
baseIcon
[
'
big
'
].
iconsize
=
new
GSize
(
30
,
51
);
baseIcon
[
'
big
'
].
shadowSize
=
new
GSize
(
56
,
51
);
baseIcon
[
'
big
'
].
iconAnchor
=
new
GPoint
(
13
,
34
);
baseIcon
[
'
big
'
].
infoWindowAnchor
=
new
GPoint
(
13
,
3
);
baseIcon
[
'
big
'
].
infoShadowAnchor
=
new
GPoint
(
27
,
37
);
baseIcon
[
'
small
'
]
=
new
GIcon
();
baseIcon
[
'
small
'
].
image
=
"
modules/gmap/markers/small/red.png
"
;
baseIcon
[
'
small
'
].
shadow
=
"
modules/gmap/markers/small/shadow.png
"
;
baseIcon
[
'
small
'
].
iconSize
=
new
GSize
(
12
,
20
);
baseIcon
[
'
small
'
].
shadowSize
=
new
GSize
(
22
,
20
);
baseIcon
[
'
small
'
].
iconAnchor
=
new
GPoint
(
6
,
20
);
baseIcon
[
'
small
'
].
infoWindowAnchor
=
new
GPoint
(
5
,
1
);
baseIcon
[
'
flat
'
]
=
new
GIcon
();
baseIcon
[
'
flat
'
].
image
=
"
modules/gmap/markers/flat/x.png
"
;
baseIcon
[
'
flat
'
].
shadow
=
""
;
baseIcon
[
'
flat
'
].
iconSize
=
new
GSize
(
16
,
16
);
baseIcon
[
'
flat
'
].
shadowSize
=
new
GSize
(
0
,
0
);
baseIcon
[
'
flat
'
].
iconAnchor
=
new
GPoint
(
8
,
8
);
baseIcon
[
'
flat
'
].
infoWindowAnchor
=
new
GPoint
(
8
,
8
);
}
function
createGMarker
(
point
,
htmltext
,
marker
)
{
if
(
marker
.
length
>
0
)
{
var
markerIcon
=
new
GIcon
(
baseIcon
);
var
re
=
/markers
\/([
a-zA-Z0-9
]
+
)\/
/
;
var
m
=
re
.
exec
(
marker
);
var
bicon
=
'
standard
'
;
if
(
m
)
{
if
(
baseIcon
[
m
[
1
]])
{
var
bicon
=
m
[
1
];
}
}
var
markerIcon
=
new
GIcon
(
baseIcon
[
bicon
]);
markerIcon
.
image
=
marker
;
var
returnMarker
=
new
GMarker
(
point
,
markerIcon
);
}
...
...
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