Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions angular-google-staticmaps.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* angular-google-staticmaps 0.0.1
* angular-google-staticmaps <%= pkg.version %>
* Pascal Hartig, weluse GmbH, http://weluse.de/
* License: MIT
*/
Expand All @@ -9,7 +9,7 @@
angular.module('wu.staticGmap', [])
.controller('StaticGmapCtrl', function () {
var BASE_URL = '//maps.googleapis.com/maps/api/staticmap?';
var STYLE_ATTRIBUTES = ['color', 'label', 'size'];
var STYLE_ATTRIBUTES = ['color', 'label', 'size', 'icon'];

this.makeMarkerStrings = function makeMarkerStrings(markers) {
return markers.map(function (marker) {
Expand Down Expand Up @@ -86,6 +86,10 @@
el.width = parseInt(sizeBits[0], 10);
el.height = parseInt(sizeBits[1], 10);
el.src = ctrl.buildSourceString(attrs, markers);

scope.$watch(attrs.markers, function (newMarkers) {
el.src = ctrl.buildSourceString(attrs, newMarkers);
});
}
};
});
Expand Down
6 changes: 5 additions & 1 deletion src/angular-google-staticmaps.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
angular.module('wu.staticGmap', [])
.controller('StaticGmapCtrl', function () {
var BASE_URL = '//maps.googleapis.com/maps/api/staticmap?';
var STYLE_ATTRIBUTES = ['color', 'label', 'size'];
var STYLE_ATTRIBUTES = ['color', 'label', 'size', 'icon'];

this.makeMarkerStrings = function makeMarkerStrings(markers) {
return markers.map(function (marker) {
Expand Down Expand Up @@ -86,6 +86,10 @@
el.width = parseInt(sizeBits[0], 10);
el.height = parseInt(sizeBits[1], 10);
el.src = ctrl.buildSourceString(attrs, markers);

scope.$watch(attrs.markers, function (newMarkers) {
el.src = ctrl.buildSourceString(attrs, newMarkers);
});
}
};
});
Expand Down