Closed memoxmrdl closed 7 years ago
Well there's more than one way. The most straightforward way I can think of is using the center_changed
event of the g-maps component and applying the map center to the marker in question. Would that work for you?
Hi Matt, yep I'm try use 'center_changed' but I have many centers that can't centering above on the map, I need something as following:
map.setCenter(new google.maps.LatLng(latitude, longitude));
Just so I understand your issue correctly, you have a group of markers that need to be updated to the new center of the map once the user has changed the center of the map?
I'm afraid I'm not sure what you mean by:
I have many centers that can't centering above on the map
However the map.setCenter(...)
code you have can be easily achieved with:
set(this, 'myMapLat', newLat)
and set(this, 'myMapLng', newLng)
where:
{{g-maps lat=myMapLat lng=myMapLng}}
Yep! sorry for my English, I understand your solution let me try again. thanks
I have a problem how can I auto-center the markers on the map?