简体   繁体   中英

How to set zoom in corona sdk mapView

I want to change the zoom settings of corona sdk's mapView, how do I change it's settings? I have done many research but haven't found 1 yet

myMap:setRegion( 3.234542, -12.123456, 0.01, 0.01 )

The last two arguments of the above function is together called the span of the mapview . Induvidually they are longitudedelta and latitudedelta (longitudeSpan/latitudeSpan). They represent how many degrees of longitude and latitude that should be visible on your mapviw.

Consequently, Setting them both to 1 will cause your mapview to display 1 degree across and 1 degree from top to bottom of the map.

Increase long/latDelta --> further from ground

Decrease --> closer to ground

Please try this

local myMap = native.newMapView( 0, 0, display.contentWidth, display.contentHeight )
myMap:setCenter( 37.331692, -122.030456, 0.01, 0.01 )

You can refer THIS

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM