diff options
author | Struan Donald <struan@exo.org.uk> | 2013-07-02 14:01:22 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2013-07-02 14:01:22 +0100 |
commit | ec39d9340f0ead4e568cf4633bd592623784f55b (patch) | |
tree | 5e1b69c4273b1506a36e1922cde52785fe624c32 /www/js/map-OpenLayers.js | |
parent | 53b2f8ec146722b76b13696af0769b67973243b1 (diff) |
default to non svg pin graphic and use svg version if we know the platform supports it
Diffstat (limited to 'www/js/map-OpenLayers.js')
-rw-r--r-- | www/js/map-OpenLayers.js | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/www/js/map-OpenLayers.js b/www/js/map-OpenLayers.js index 372d09a..6b0d8f6 100644 --- a/www/js/map-OpenLayers.js +++ b/www/js/map-OpenLayers.js @@ -65,6 +65,15 @@ function fixmystreet_onload() { backgroundGraphicZIndex: 10 }) }); + var location_img = 'i/location_pin.png'; + var location_bg_img = 'i/location_pin_shadow.png'; + if ( typeof device !== 'undefined' && + (device.platform == 'Android' && parseInt(device.version, 10) > 2) || + (device.platform !== 'Android') ) { + location_img = 'i/pin.svg'; + location_bg_img = 'i/pin_shadow.svg'; + } + pin_layer_style_map.addUniqueValueRules('default', 'size', { 'normal': { externalGraphic: "i/pin-${colour}.png", @@ -91,12 +100,12 @@ function fixmystreet_onload() { backgroundYOffset: -35 }, 'location': { - externalGraphic: "i/pin.svg", + externalGraphic: location_img, graphicWidth: 70, graphicHeight: 110, graphicXOffset: -35, graphicYOffset: -110, - backgroundGraphic: "i/pin_shadow.svg", + backgroundGraphic: location_bg_img, backgroundWidth: 186, backgroundHeight: 110, backgroundXOffset: -93, |