From 3db1953303d95cbf72f9bb1159dd5549d06f5fd8 Mon Sep 17 00:00:00 2001 From: Andrew Chin Date: Fri, 21 Jan 2011 21:11:39 -0500 Subject: [PATCH] a signGroup can now have an optional icon URL --- config.js | 4 +++- web_assets/functions.js | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/config.js b/config.js index b339192..ac301cc 100644 --- a/config.js +++ b/config.js @@ -19,12 +19,14 @@ * * Optional: * checked : boolean. Set to true to have the group visible by default + * icon : string. Used to specify an icon url. */ var signGroups = [ // {label: "'To'", checked: false, match: function(s) {return s.msg.match(/to/)}}, // {label: "Storage", match: function(s) {return s.msg.match(/storage/i) || s.msg.match(/dirt/i) || s.msg.match(/sand/)}}, // {label: "Below Sealevel", match: function(s) { return s.y<64;}}, - {label: "All", match: function(s) {return true}} +// {label: "Info", match: function(s) { return s.msg.match("\\[info\\]");}, icon:"http://google-maps-icons.googlecode.com/files/info.png"}, + {label: "All", match: function(s) {return true}}, ]; /* mapTypeData -- a list of alternate map renderings available. At least one rendering must be diff --git a/web_assets/functions.js b/web_assets/functions.js index a80c758..ff8da92 100644 --- a/web_assets/functions.js +++ b/web_assets/functions.js @@ -184,6 +184,10 @@ function initMarkers() { if (item.type == 'sign') { iconURL = 'signpost_icon.png';} + console.log(signGroup.icon); + if (signGroup.icon) { iconURL = signGroup.icon; + } + var converted = fromWorldToLatLng(item.x, item.y, item.z); var marker = new google.maps.Marker({position: converted, map: map,