From ecb72f28eae8f5dc4399c5d814b8e439856ec70c Mon Sep 17 00:00:00 2001 From: rolux Date: Wed, 4 Apr 2012 00:36:45 +0200 Subject: [PATCH] allow for markers on Ox.MapImage --- source/Ox.UI/js/Map/Ox.MapImage.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/source/Ox.UI/js/Map/Ox.MapImage.js b/source/Ox.UI/js/Map/Ox.MapImage.js index 04cf62d7..bddd6cf5 100644 --- a/source/Ox.UI/js/Map/Ox.MapImage.js +++ b/source/Ox.UI/js/Map/Ox.MapImage.js @@ -23,7 +23,8 @@ Ox.MapImage = function(options, self) { backgroundColor: [0, 0, 0, 0], borderColor: [0, 0, 0, 0], borderWidth: 0, - height: 360, + height: 640, + markers: [], place: null, type: 'satellite', width: 640 @@ -54,6 +55,12 @@ Ox.MapImage = function(options, self) { } else { self.src += '¢er=0,0&zoom=2' } + if (self.options.markers.length) { + self.src += '&markers=' + + self.options.markers.map(function(marker) { + return [marker.lat, marker.lng].join(',') + }).join('|'); + } that.attr({ src: self.src