Limit Map Area

4 posts, 0 answers
  1. Ryad
    Ryad avatar
    2 posts
    Member since:
    May 2015

    Posted 06 May 2015 Link to this post

    Hi,

     I have a special need where I want to limit the user to see only a specific zone of the map and nothing except that zone. for example he just can see France country and nothing outside that area.

    Is there a way to set this by coding?

     

    Thanks

  2. Ianko
    Admin
    Ianko avatar
    1535 posts

    Posted 08 May 2015 Link to this post

    Hi Ryad,

    You can just disable the panning and the zooming:

    <telerik:RadMap runat="server" ID="RadMap1" Pannable="false" Zoomable="false"></telerik:RadMap>

    And just to configure RadMap to show France, or whatever is needed via the Center's Longitude and L attitude properties.

    Regards,
    Ianko
    Telerik
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Ryad
    Ryad avatar
    2 posts
    Member since:
    May 2015

    Posted 08 May 2015 in reply to Ianko Link to this post

    Hello lanko,

    Thanks for the tip, I'll give it a try, it looks interesting.

    Do you know if possible to apply a code like the one in the below link (this is exactly what I want):

    https://www.mapbox.com/mapbox.js/example/v1.0.0/maxbounds/

  5. Ianko
    Admin
    Ianko avatar
    1535 posts

    Posted 08 May 2015 Link to this post

    Hello,

    Yes, the suggestion below leads almost to the same beahvior.

    Additionally, you can configure the MinZoom and MaxZoom values with some suitable values.
    <telerik:RadMap runat="server" ID="RadMap1"  Width="600px" Height="400px"
        Zoomable="false" Pannable="false" Zoom="8" MinZoom="6" MaxZoom="10">
        <CenterSettings Latitude="40.712" Longitude="-74.227" />
        <LayersCollection>
            <telerik:MapLayer Type="Tile" Subdomains="a,b,c"
                UrlTemplate="http://#= subdomain #.tile.openstreetmap.org/#= zoom #/#= x #/#= y #.png"
                Attribution="© <a href='http://osm.org/copyright' title='OpenStreetMap contributors' target='_blank'>OpenStreetMap contributors</a>.">
            </telerik:MapLayer>
        </LayersCollection>
    </telerik:RadMap>



    Regards,
    Ianko
    Telerik
Back to Top