|
|||||||
|
|
|
![]() |
|
|
Strumenti |
|
|
#1 |
|
Senior Member
Iscritto dal: Apr 2009
Città: Aci Catena (CT)
Messaggi: 1021
|
[OpenLayer] "Bounds" e "maxExtent": di cosa di tratta?
Salve a tutti,
sto lavorando ad un progetto ove è necessario utilizzare OpenLayers 2 e MapServer. Nella creazione di una mappa sono necessari i seguenti parametri: - Bounds; - maxExtent. Esattamente sapere dirmi di cosa si tratta? Come li ottengo? In un esempio recuperato sul web ho trovato la seguente funzione: Codice:
var mapBounds = new OpenLayers.Bounds(14.9993397108, 37.5982084681, 15.0827501864, 37.6482928821);
var options = {
projection: new OpenLayers.Projection("EPSG:900913"),
displayProjection: new OpenLayers.Projection("EPSG:4326"),
units: "m",
zoom: 12,
numZoomLevels: 21,
maxExtent: new OpenLayers.Bounds(-20037508, -20037508, 20037508, 20037508.34)
};
map = new OpenLayers.Map('map', options);
......
map.zoomToExtent(mapBounds.transform(map.displayProjection, map.projection));
Grazie. |
|
|
|
|
| Strumenti | |
|
|
Tutti gli orari sono GMT +1. Ora sono le: 17:02.


















