Skip to content
Snippets Groups Projects
Commit 7592e0e0 authored by webgeer's avatar webgeer
Browse files

Add custom marker types

parent b1cd3093
No related branches found
No related tags found
No related merge requests found
/* $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);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment