MapView.ViewPin (API Reference)
Interface MapView.ViewPin
- Enclosing class:
- MapView
The pinned view will automatically be repositioned on the screen as the map moves. There is more performance overhead involved in positioning a pinned view as compared to a map marker, so for use cases which only require static images, markers should be used.
-
Method Summary
Modifier and TypeMethodDescriptionGets anchor point for this instance.Returns the current GeoCoordinates on the map.voidsetAnchorPoint(Anchor2D anchorPoint) Sets an anchor point for this instance.voidsetGeoCoordinates(GeoCoordinates geoCoordinates) Sets the GeoCoordinates on the map.voidunpin()Removes the view from theMapViewit was pinned to.
-
Method Details
-
unpin
void unpin()Removes the view from theMapViewit was pinned to. -
getGeoCoordinates
GeoCoordinates getGeoCoordinates()Returns the current GeoCoordinates on the map.- Returns:
- The current GeoCoordinates.
-
setGeoCoordinates
Sets the GeoCoordinates on the map.The altitude component of the coordinates, if set, is interpreted as above sea level. When not set, the coordinates are interpreted as at ground level.
- Parameters:
geoCoordinates- Desired GeoCoordinates for this view pin.
-
setAnchorPoint
Sets an anchor point for this instance.The anchor value has valid range from 0 to 1. Zero (0) for x and y means the view pin's upper left corner is located at the geographical location, whereas one (1) for x and y means that the pin will have its right bottom corner attached to the geographical location instead. The default value used is 0.5, 0.5, causing the view to be centered.
- Parameters:
anchorPoint- AAnchor2Drelative to the top-left corner of theViewPin.
-
getAnchorPoint
Anchor2D getAnchorPoint()Gets anchor point for this instance.- Returns:
- anchorPoint A
Anchor2Drelative to the top-left corner of theViewPin.
-