File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
src/coffee/directives/api Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -142,8 +142,14 @@ angular.module('uiGmapgoogle-maps.directives.api')
142142
143143 updateCenter = (c = _gMap .center , s = scope ) ->
144144 unless _ .includes disabledEvents, ' center'
145- s .center .latitude = c .lat () if s .center .latitude isnt c .lat ()
146- s .center .longitude = c .lng () if s .center .longitude isnt c .lng ()
145+ cLat = c .lat ()
146+ cLng = c .lng ()
147+ if angular .isDefined (s .center .type )
148+ s .center .coordinates [1 ] = cLat if s .center .coordinates [1 ] isnt cLat
149+ s .center .coordinates [0 ] = cLng if s .center .coordinates [0 ] isnt cLng
150+ else
151+ s .center .latitude = cLat if s .center .latitude isnt cLat
152+ s .center .longitude = cLng if s .center .longitude isnt cLng
147153
148154 settingFromDirective = false
149155 maybeHookToEvent ' idle' , ->
You can’t perform that action at this time.
0 commit comments