com.neomades.maps.Map |
The main class of the Maps API and the entry point for all methods related to the map. You cannot instantiate a Map object directly, rather, you must obtain one from the getMap() method on a MapView that you have added to your application.
Note: Similar to a View object, a Map can only be read and modified from the main thread. Calling Map methods from another thread will result in an exception.
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
abstract Map |
add(Overlay overlay)
Adds an overlay to this map.
| ||||||||||
abstract Map |
add(Marker marker)
Adds a marker to this map.
| ||||||||||
abstract void |
clear()
Removes all markers, polylines, polygons, overlays, etc from the map.
| ||||||||||
abstract Point |
convertLocationToPoint(Location location)
Returns a screen location that corresponds to a geographical coordinate
(Location).
| ||||||||||
abstract Location |
convertPointToLocation(Point point)
Returns the geographic location that corresponds to a screen location.
| ||||||||||
abstract MapCamera | getCamera() | ||||||||||
abstract MapSettings | getMapSettings() | ||||||||||
abstract Location |
getMyLocation()
Returns the currently displayed user location, or null if there is no
location data available.
| ||||||||||
abstract void |
setInfoWindowClickListener(InfoWindowClickListener listener)
Sets a callback that is invoked when the info window of a marker is clicked.
| ||||||||||
abstract void |
setMapListener(MapListener listener)
Sets a callback that is invoked when this map has finished rendering.
| ||||||||||
abstract void |
setMarkerClickListener(MarkerClickListener listener)
Sets a callback that is invoked when a marker is clicked.
| ||||||||||
abstract void |
setMarkerDragListener(MarkerDragListener listener)
Sets a callback that is invoked when a marker is dragged.
| ||||||||||
abstract void |
setMyLocationChangeListener(MyLocationClickListener listener)
Sets a callback that is invoked when the my location button is clicked.
| ||||||||||
abstract void |
setOnMapClickListener(OnMapClickListener listener)
Sets a callback that is invoked when the map is clicked.
|
Adds an overlay to this map.
overlay | An overlay (circle, polyline, polygone, etc) that defines how to render the overlay. |
---|
Adds a marker to this map.
The marker's icon is rendered on the map at the location Marker.position. Clicking the marker centers the camera on the marker. If Marker.title is defined, the map shows an info box with the marker's title and snippet. If the marker is draggable, long-clicking and then dragging the marker moves it.
In Android, two overlays with the default z-index are drawn in an arbitrary order (the add() order is not the z-index). The z-index specifies the stack order of each overlay, relative to other overlays.
marker | A marker object that defines how to render the marker. |
---|
Removes all markers, polylines, polygons, overlays, etc from the map.
Returns a screen location that corresponds to a geographical coordinate (Location).
location | A Location on the map to convert to a screen location. |
---|
Returns the geographic location that corresponds to a screen location. The screen location is specified in screen pixels (not display pixels) relative to the top left of the map (not the top left of the whole screen).
point | A Point on the screen in screen pixels. |
---|
Returns the currently displayed user location, or null if there is no location data available.
Sets a callback that is invoked when the info window of a marker is clicked.
listener | The callback that is invoked. To unset the callback, use null. |
---|
Sets a callback that is invoked when this map has finished rendering.
The callback will only be invoked once. If this method is called when the map is fully rendered, the callback will be invoked immediately. This event will not fire if the map never loads due to connectivity issues, or if the map is continuously changing and never completes loading due to the user constantly interacting with the map.
listener | The callback that is invoked. To unset the callback, use null. |
---|
Sets a callback that is invoked when a marker is clicked. This callback is not called if the info window of the marker is shown.
listener | The callback that is invoked. To unset the callback, use null. |
---|
Sets a callback that is invoked when a marker is dragged.
listener | The callback that is invoked. To unset the callback, use null. |
---|
Sets a callback that is invoked when the my location button is clicked.
listener | The callback that is invoked. To unset the callback, use null. |
---|
Sets a callback that is invoked when the map is clicked.
listener | The callback that is invoked. To unset the callback, use null. |
---|