Restrictmap is not working

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Restrictmap is not working

adityakumar529
Hi Users,


function init()
        {
        map =new OpenLayers.Map({
                        div: "map",
                        projection: new OpenLayers.Projection("EPSG:4326"),
                         maxExtent: new OpenLayers.Bounds(77.32,12.66,77.81,73.23),
                        restrictExtent: new OpenLayers.Bounds(77.32,12.66,77.81,73.23)
                });
                               
                var gmap = new OpenLayers.Layer.Google(
        "Google Streets", // the default
        {numZoomLevels: 20, visibility: false}
    );
                var osm =new OpenLayers.Layer.Google(
        "Google Hybrid",
        {type: google.maps.MapTypeId.HYBRID, numZoomLevels: 20, visibility: false}
    );
               
                  var googlemap = new OpenLayers.Layer.OSM();
               
                map.addLayers([osm,gmap,googlemap]);
               


Following is the code I have used but I am not restrict my map.

Any idea how to fix it?

Aditya Kumar


               
                 
                       
       
       
       
       
       
                 
GIS Developer
Reply | Threaded
Open this post in threaded view
|

Re: Restrictmap is not working

Jerome A. Wendell
The parameter is actually restrictedExtent.

Hope this helps.

Jerome A. Wendell


-----Original Message-----
From: Users [mailto:[hidden email]] On Behalf Of adityakumar529
Sent: Sunday, November 29, 2015 1:17 PM
To: [hidden email]
Subject: [OpenLayers-Users] Restrictmap is not working

Hi Users,


function init()
        {
        map =new OpenLayers.Map({
                        div: "map",
                        projection: new OpenLayers.Projection("EPSG:4326"),
                         maxExtent: new OpenLayers.Bounds(77.32,12.66,77.81,73.23),
                        restrictExtent: new OpenLayers.Bounds(77.32,12.66,77.81,73.23)
                });
                               
                var gmap = new OpenLayers.Layer.Google(
        "Google Streets", // the default
        {numZoomLevels: 20, visibility: false}
    );
                var osm =new OpenLayers.Layer.Google(
        "Google Hybrid",
        {type: google.maps.MapTypeId.HYBRID, numZoomLevels: 20, visibility:
false}
    );
               
                  var googlemap = new OpenLayers.Layer.OSM();
               
                map.addLayers([osm,gmap,googlemap]);
               


Following is the code I have used but I am not restrict my map.

Any idea how to fix it?

Aditya Kumar


               
                 
                       
       
       
       
       
       
                 



-----
GIS Developer

--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Restrictmap-is-not-working-tp5239041.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
_______________________________________________
Users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/openlayers-users

_______________________________________________
Users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/openlayers-users