Skip to content
This repository was archived by the owner on May 25, 2019. It is now read-only.

Commit 1a68065

Browse files
committed
[FIX] Marker bug
1 parent bb3a1ec commit 1a68065

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

demo/demo.html

+3-4
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ <h1>Marker</h1>
3535
<!--Giving the div an id="map_canvas" fix problems with twitter bootstrap affecting
3636
google maps-->
3737
<div id="map_canvas" ui-map="myMap" class="span8 map"
38-
ui-map-promise="onGoogleReady.promise"
39-
ui-event="{'map-click': 'addMarker($event)', 'map-zoom_changed': 'setZoomMessage(myMap.getZoom())' }"
38+
ui-event="{'map-click': 'addMarker($event, $params)', 'map-zoom_changed': 'setZoomMessage(myMap.getZoom())' }"
4039
ui-options="mapOptions">
4140
</div>
4241
</div>
@@ -67,7 +66,7 @@ <h3>How?</h3>
6766
&lt;!-- Giving the div an id="map_canvas" fix problems with twitter bootstrap affecting
6867
google maps --&gt;
6968
&lt;div id=&quot;map_canvas&quot; ui-map=&quot;myMap&quot; class=&quot;map&quot;
70-
ui-event=&quot;{&#x27;map-click&#x27;: &#x27;addMarker($event)&#x27;, &#x27;map-zoom_changed&#x27;: &#x27;setZoomMessage(myMap.getZoom())&#x27; }&quot;
69+
ui-event=&quot;{&#x27;map-click&#x27;: &#x27;addMarker($event, $params)&#x27;, &#x27;map-zoom_changed&#x27;: &#x27;setZoomMessage(myMap.getZoom())&#x27; }&quot;
7170
ui-options=&quot;mapOptions&quot;&gt;
7271
&lt;/div&gt;
7372

@@ -83,7 +82,7 @@ <h3>How?</h3>
8382
$scope.addMarker = function($event) {
8483
$scope.myMarkers.push(new google.maps.Marker({
8584
map: $scope.myMap,
86-
position: $event.latLng
85+
position: $params[0].latLng
8786
}));
8887
};
8988

demo/demo.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ angular.module('doc.ui-map', ['ui.map', 'prettifyDirective'])
1414
mapTypeId: google.maps.MapTypeId.ROADMAP
1515
};
1616

17-
$scope.addMarker = function ($event) {
17+
$scope.addMarker = function ($event, $params) {
1818
$scope.myMarkers.push(new google.maps.Marker({
1919
map: $scope.myMap,
20-
position: $event.latLng
20+
position: $params[0].latLng
2121
}));
2222
};
2323

0 commit comments

Comments
 (0)