plugins icon indicating copy to clipboard operation
plugins copied to clipboard

nativescript/google-maps not centering map to marker at iOS

Open BoxSo opened this issue 3 years ago • 3 comments
trafficstars

I'm adding a marker to the map within the onReady Event of my map.

Problem:

  • after adding a marker to the map, the app centers to the added Marker at android ==> ok
  • after adding a marker to the map, the app centers to Stonehenge at iOS ==> NOT ok

Funny part is, that the marker is at the map and at the defined position. Only the map is not centered to the marker (and no, i'm not testing the app at Stonehenge ;) )

Tested with Device (iPhone 13).

How can i center my map to given lat / lon coordinates? As i could not find any documentation this might be a problem at my side.

BoxSo avatar Jun 29 '22 09:06 BoxSo

You can try the following

  const position = map.cameraPosition;
  position.target = {
  lat: 10.495829,
  lng: -61.382675
  };
  position.zoom = 10;
  map.cameraPosition = position;

triniwiz avatar Jun 29 '22 15:06 triniwiz

Thanks, but that also does not position the map center to my marker. Tried with fixed coordinates as you wrote.

BoxSo avatar Jun 30 '22 07:06 BoxSo

image tried it that way.

Still centered to Stonehenge at iOS devices. The Marker is correctly added.

BoxSo avatar Jun 30 '22 07:06 BoxSo