Skip to content

Commit d7d236e

Browse files
committed
Revert "Revert "allenhwkim#558, reverted changes""
This reverts commit 04972d8.
1 parent 04972d8 commit d7d236e

File tree

1 file changed

+21
-18
lines changed

1 file changed

+21
-18
lines changed

directives/custom-marker.js

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -148,24 +148,27 @@
148148
console.log("custom-marker options", options);
149149
var customMarker = new CustomMarker(options);
150150

151-
152-
scope.$watch('[' + varsToWatch.join(',') + ']', function() {
153-
customMarker.setContent(orgHtml, scope);
154-
}, true);
155-
156-
customMarker.setContent(element[0].innerHTML, scope);
157-
var classNames = element[0].firstElementChild.className;
158-
customMarker.addClass('custom-marker');
159-
customMarker.addClass(classNames);
160-
console.log('customMarker', customMarker, 'classNames', classNames);
161-
162-
if (!(options.position instanceof google.maps.LatLng)) {
163-
NgMap.getGeoLocation(options.position).then(
164-
function(latlng) {
165-
customMarker.setPosition(latlng);
166-
}
167-
);
168-
}
151+
$timeout(function() { //apply contents, class, and location after it is compiled
152+
153+
scope.$watch('[' + varsToWatch.join(',') + ']', function() {
154+
customMarker.setContent(orgHtml, scope);
155+
}, true);
156+
157+
customMarker.setContent(element[0].innerHTML, scope);
158+
var classNames = element[0].firstElementChild.className;
159+
customMarker.addClass('custom-marker');
160+
customMarker.addClass(classNames);
161+
console.log('customMarker', customMarker, 'classNames', classNames);
162+
163+
if (!(options.position instanceof google.maps.LatLng)) {
164+
NgMap.getGeoLocation(options.position).then(
165+
function(latlng) {
166+
customMarker.setPosition(latlng);
167+
}
168+
);
169+
}
170+
171+
});
169172

170173
console.log("custom-marker events", "events");
171174
for (var eventName in events) { /* jshint ignore:line */

0 commit comments

Comments
 (0)