Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

How to restrict where users can scroll & zoom to on a map view in iOS

$
0
0

Hi chaps,

Quick one here.

I'm looking to prevent users from scrolling endlessly around a map view in my iOS app.

Also, making sure they can't zoom out too far.

This is the code I'm using to set the default position and zoom level of my map.

var mapview = Map.createView({
    mapType: Map.STANDARD_TYPE,
    region: {
        latitude: 51.535125,
        longitude: -0.154216,
        latitudeDelta: 0.005,
        longitudeDelta: 0.005
    },
    animate: true,
    regionFit: true,
    userLocation: true,
    showsBuildings: false,
    showsPointsOfInterest: false,
    annotations: annotations,
    tintColor:'#6ea108',
    pitchEnabled:false
});
So, the question is;
  1. Can I set a lat/lon combination which will prevent them from scrolling too far away?

  2. Can I set a maximum zoomed out value?

Any help would be greatly appreciated!

Simon


Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>