Hi,
This is a question regarding the angular-google-maps directive, and I'm
hoping someone may have the answer.

I am noticing inconsistent behaviour when displaying markers with ng-repeat
vs the model approach.  See the following snippets:

///// ng-repeat
 <ui-gmap-marker ng-repeat="m in alertMarkers" coords="m" icon="m.icon"
click="onMarkerClicked(m)" doCluster="map.cluster" idKey="m.id"
options="m.options">
                <ui-gmap-window ng-cloak>
                    <div>
                        <p class="fs-subhead">{{m.info.event}}</p>
                        <p>Sender: {{m.info.senderName}}</p>
                        <p>Coordinates: {{ m.latitude | number:4 }}, {{
m.longitude | number:4 }}!</p>
                    </div>
                </ui-gmap-window>
            </ui-gmap-marker>


///// models
           <ui-gmap-markers models="alertMarkers" coords="'self'"
icon="'icon'" click="onMarkerClicked" doCluster="map.cluster">
    <ui-gmap-windows show="'showWindow'" ng-cloak doRebuildAll="false"
options="{disableAutoPan: true}">
        <div>
            <p ng-non-bindable class="fs-subhead">{{info.event}}</p>
            <p ng-non-bindable>Sender: {{info.senderName}}</p>
            <p ng-non-bindable>Coordinates: {{ latitude | number:4 }}, {{
longitude | number:4 }}!</p>
        </div>
    </ui-gmap-windows>
</ui-gmap-markers>

Let's say I have two markers in the alertMarkers array, and both
infoWindows are open.  One marker is in Montreal, and one marker in Toronto.

When using the models approach if I close the marker in Montreal, the map
automatically centers/focuses to the marker/infoWindow in Toronto.

If I replace the models code with the ng-repeat approach, the above does
not happen.  If I close the infoWindow in Montreal, the map stays in the
current position.  This is the behaviour that I want to achieve with the
models approach, and I would prefer to use the models approach for
performance reasons.

The docs indicate that by setting disableAutoPan to true, this should
prevent the jump, however I haven't been able to get it to work.  I'm
hoping someone on the list may have a quick answer to this question.

On a side note, it appears that the doCluster option does not work when
using ng-repeat.

Thanks!

Nolan

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to