|
148 | 148 | console.log("custom-marker options", options);
|
149 | 149 | var customMarker = new CustomMarker(options);
|
150 | 150 |
|
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 | + }); |
169 | 172 |
|
170 | 173 | console.log("custom-marker events", "events");
|
171 | 174 | for (var eventName in events) { /* jshint ignore:line */
|
|
0 commit comments