[OpenLayers-Dev] Very confused

jezjones jez at dianetsystems.net
Tue Jun 7 05:17:11 EDT 2011


I apologise if this is a really noobie question, but i cant figure out bounds
and extent and maxextent and restrictedExtent

I am using an OMS layer, which forces me to use bounds of
 (-20037508.34,-20037508.34,20037508.34,20037508.34);

I cannot see how i can limit either my map's restrictedExtent area or the
zoom out to the world.

I am using my own google tiles, and i have got my map to only show my tiles,
but i want to acheive the following;-

1) Show my own tiles - Yes, i can do that
2) limit the pan and zoom - No, cant do that
3) show different content at fixed zoom levels. - Yes, but cant control how
zoomed each level is or how many zoom levels (i want 4 only).

This is pretty much the mission statement of open layers, but I am finding
it pretty difficult to do.. i am a JS dev, not a GIS dev and the GIS
language is just confusing me.

Please help.

Thanks,

Jez 
CODE:


var extent = new
OpenLayers.Bounds(-20037508.34,-20037508.34,20037508.34,20037508.34);
function show_map(){
  var proj = new OpenLayers.Projection("EPSG:4326");
  map = new OpenLayers.Map({
    div: "map",
    theme: null,
    allOverlays: true,
    maxExtent: extent,
    units:'m',
    projection: "EPSG:900913",
    displayProjection: new OpenLayers.Projection("EPSG:4326"),
    controls: [
      new OpenLayers.Control.TouchNavigation({
            dragPanOptions: {
              interval: 100,
              enableKinetic: true
            }
      }),
      new OpenLayers.Control.ZoomPanel(),
      new OpenLayers.Control.PinchZoom()
    ]
  });


  var mattmap = new OpenLayers.Layer.OSM("Mat Map", "tiles/", {
'type':'png', 'getURL':get_my_url, isBaseLayer: true, restrictedExtent:
extent});
  var markers = new OpenLayers.Layer.Markers( "Markers" );




  map.addLayers([mattmap, markers, sponsoredMarkers, campsitesCarparks]);
  var point = new OpenLayers.LonLat(0.43705, 51.713203);
  map.setCenter(point.transform(proj, map.getProjectionObject()), 12);
    

--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Very-confused-tp6448725p6448725.html
Sent from the OpenLayers Dev mailing list archive at Nabble.com.


More information about the Dev mailing list