From edc8c8979403479438d9b6ddc47c4f6214ac6538 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Fri, 5 Dec 2008 14:29:57 +0000 Subject: added makeIcon --- img/marker_blue.png | Bin 0 -> 3237 bytes img/marker_darkred.png | Bin 0 -> 3050 bytes img/marker_grey.png | Bin 0 -> 3226 bytes img/marker_grey_trans.png | Bin 0 -> 493 bytes img/marker_large.png | Bin 0 -> 4029 bytes img/marker_medium.png | Bin 0 -> 3591 bytes img/marker_offline.png | Bin 0 -> 296 bytes img/marker_online.png | Bin 0 -> 280 bytes img/marker_shadow.png | Bin 0 -> 436 bytes img/marker_tunnel.png | Bin 0 -> 285 bytes img/marker_white.png | Bin 0 -> 3174 bytes img/marker_yellow.png | Bin 0 -> 3206 bytes map.js | 25 ++++++++++++++++++++----- 13 files changed, 20 insertions(+), 5 deletions(-) create mode 100644 img/marker_blue.png create mode 100644 img/marker_darkred.png create mode 100644 img/marker_grey.png create mode 100644 img/marker_grey_trans.png create mode 100644 img/marker_large.png create mode 100644 img/marker_medium.png create mode 100644 img/marker_offline.png create mode 100644 img/marker_online.png create mode 100644 img/marker_shadow.png create mode 100644 img/marker_tunnel.png create mode 100644 img/marker_white.png create mode 100644 img/marker_yellow.png diff --git a/img/marker_blue.png b/img/marker_blue.png new file mode 100644 index 0000000..1ec7f8c Binary files /dev/null and b/img/marker_blue.png differ diff --git a/img/marker_darkred.png b/img/marker_darkred.png new file mode 100644 index 0000000..d5b29d4 Binary files /dev/null and b/img/marker_darkred.png differ diff --git a/img/marker_grey.png b/img/marker_grey.png new file mode 100644 index 0000000..f74e0be Binary files /dev/null and b/img/marker_grey.png differ diff --git a/img/marker_grey_trans.png b/img/marker_grey_trans.png new file mode 100644 index 0000000..60f8597 Binary files /dev/null and b/img/marker_grey_trans.png differ diff --git a/img/marker_large.png b/img/marker_large.png new file mode 100644 index 0000000..d9c1be0 Binary files /dev/null and b/img/marker_large.png differ diff --git a/img/marker_medium.png b/img/marker_medium.png new file mode 100644 index 0000000..51575d2 Binary files /dev/null and b/img/marker_medium.png differ diff --git a/img/marker_offline.png b/img/marker_offline.png new file mode 100644 index 0000000..d67f19e Binary files /dev/null and b/img/marker_offline.png differ diff --git a/img/marker_online.png b/img/marker_online.png new file mode 100644 index 0000000..b6c3a43 Binary files /dev/null and b/img/marker_online.png differ diff --git a/img/marker_shadow.png b/img/marker_shadow.png new file mode 100644 index 0000000..3a89759 Binary files /dev/null and b/img/marker_shadow.png differ diff --git a/img/marker_tunnel.png b/img/marker_tunnel.png new file mode 100644 index 0000000..7594826 Binary files /dev/null and b/img/marker_tunnel.png differ diff --git a/img/marker_white.png b/img/marker_white.png new file mode 100644 index 0000000..2d8e0cc Binary files /dev/null and b/img/marker_white.png differ diff --git a/img/marker_yellow.png b/img/marker_yellow.png new file mode 100644 index 0000000..7d81cdb Binary files /dev/null and b/img/marker_yellow.png differ diff --git a/map.js b/map.js index 34a5c00..718de7c 100644 --- a/map.js +++ b/map.js @@ -106,8 +106,25 @@ function addNewNodeText(point) { return html; } +function makeIcon(type) { + var icon = new GIcon(); + + switch(type) { + case 'online': icon.image = "./img/marker_online.png"; break; + case 'tunnel': icon.image = "./img/marker_tunnel.png"; break; + case 'offline': icon.image = "./img/marker_offline.png"; break; + case 'ruler': icon.image = "./img/marker_blue.png"; break; + case 'newnode': icon.image = "./img/marker_darkred.png"; + } + icon.iconSize = new GSize(12,20); + icon.iconAnchor = new GPoint(6,20); + icon.infoWindowAnchor = new GPoint(5,1); + return icon +} + + function setNewMarker(point) { - var marker = new GMarker(point,{draggable: true}); + var marker = new GMarker(point,{icon: makeIcon('newnode'), draggable: true}); GEvent.addListener(marker, "dragstart", function() { this.autoclosed = true; @@ -197,14 +214,12 @@ RulerControl.prototype.initialize = function(map) { } var pnt = map.getCenter(); -// marker1 = new GMarker(pnt, {icon: makeIcon('messen'), draggable: true}); - marker1 = new GMarker(pnt, {draggable: true}); + marker1 = new GMarker(pnt, {icon: makeIcon('ruler'), draggable: true}); marker1.overlaytype = "ruler"; marker1.overlaysubtype = "marker1"; map.addOverlay(marker1); -// marker2 = new GMarker(pnt, {icon: makeIcon('messen'), draggable: true}); - marker2 = new GMarker(pnt, {draggable: true}); + marker2 = new GMarker(pnt, {icon: makeIcon('ruler'), draggable: true}); marker2.overlaytype = "ruler"; marker2.overlaysubtype = "marker2"; map.addOverlay(marker2); -- cgit v1.2.1