Type Function Object Map Library native.* Return value none Revision 2017.3060 Keywords setCenter See also object:setRegion()
Moves the displayed map region to a new location, using the new center point but maintaining the zoom level. The final parameter is an optional boolean (default false
) that determines whether the transition is animated or happens instantly.
object:setCenter( latitude, longitude [, isAnimated] )
Number. The latitude of the map's center point.
Number. The longitude of the map's center point.
Boolean. Specifies whether the transition is animated (true
) or happens instantly (false
, the default).
local myMap = native.newMapView( 0, 0, display.contentWidth, display.contentHeight ) myMap:setCenter( 37.331692, -122.030456 )