object:removeMarker()

Type Function
Object Map
Library native.*
Return value none
Revision 2014.2524
Keywords removeMarker
See also object:removeAllMarkers()
object:addMarker()

Overview

Clears a specific marker (pin) from the map.

Syntax

object:removeMarker( markerID )
markerID (required)

Number. The marker's identification number, for example the value returned from the object:addMarker() function.

Example

local myMap = native.newMapView( 0, 0, 300, 220 )
myMap.x = display.contentCenterX
myMap.y = display.contentCenterY

local options = { title="Displayed Title", subtitle="subtitle text" }
local markerID = myMap:addMarker( 37.331692, -122.030456, options )

--At some later time/event
myMap:removeMarker( markerID )