I use the following code to display a single marker at a zoom level but it doesn't center tha marker on the map. Only one marker will ever be shown:
LatLng latLng = new LatLng(Latitude, Longitude);
cameraUpdate = CameraUpdateFactory.newLatLngZoom(latLng, 11.0f);
This code will center it but it doesn't provide any zoom:
LatLngBounds bounds = latLngBuilder.build();
cameraUpdate = CameraUpdateFactory.newLatLngBounds(bounds, 30);
I need to center AND zoom.
Long press the marker to enable dragging. When you take your finger off the screen, the marker will remain in that position. Markers are not draggable by default. You must explicitly set the marker to be draggable either with MarkerOptions.
If you create your custom marker using SVG it can be done quite easily using transform="rotate(deg centerX centerY") . Thanks, I found this The symbol's path, which is a built-in symbol path, or a custom path expressed using SVG path notation. Precisely, so you could add your own SVG-symbols using that.
To edit the marker color, click or tap on the marker icon. When you do that, you can change both the color of the marker and its style. Go for the color or style you want to change and then click OK to see the effect. Click on the button labeled Done to save your new marker color settings.
this is because you need to move you camera to the CameraUpdateFactory
you created, like this:
LatLng latLng = new LatLng(Latitude, Longitude);
map.animateCamera(CameraUpdateFactory.newLatLng(latLng, 11);
if you don't want the animation, then you could just use:
map.moveCamera(CameraUpdateFactory.newLatLng(latLng, 11);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With