tecnica:gps_cartografia_gis:openlayers_900913
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| tecnica:gps_cartografia_gis:openlayers_900913 [2010/11/05 14:23] – niccolo | tecnica:gps_cartografia_gis:openlayers_900913 [2010/11/05 14:47] (current) – niccolo | ||
|---|---|---|---|
| Line 11: | Line 11: | ||
| Vedere la FAQ a proposito di **[[http:// | Vedere la FAQ a proposito di **[[http:// | ||
| + | |||
| + | ===== Il codice JavaScript ===== | ||
| + | |||
| + | OpenLayers supporta attualmente le mappe OpenStreetMap tramite l' | ||
| + | |||
| + | Esiste la possibilità di caricare una piccola libreria JavaScript che estende l' | ||
| + | |||
| + | Il codice JavaScript è disponibile al seguente indirizzo: [[http:// | ||
| + | |||
| + | Alcuni esempi basici si trovano qui: **[[http:// | ||
| + | |||
| + | Ecco ad esempio un estratto di codice JavaScript: | ||
| + | |||
| + | <code javascript> | ||
| + | // Define the map object. | ||
| + | map = new OpenLayers.Map(' | ||
| + | maxExtent: new OpenLayers.Bounds(-20037508.34, | ||
| + | controls: [ | ||
| + | new OpenLayers.Control.Navigation(), | ||
| + | new OpenLayers.Control.PanZoomBar(), | ||
| + | new OpenLayers.Control.LayerSwitcher(), | ||
| + | new OpenLayers.Control.KeyboardDefaults(), | ||
| + | new OpenLayers.Control.Scale() | ||
| + | ], | ||
| + | scales: [500000, 200000, 100000, 50000, 25000, 10000, 5000], | ||
| + | units: ' | ||
| + | projection: new OpenLayers.Projection(" | ||
| + | displayProjection: | ||
| + | }); | ||
| + | |||
| + | // Add OpenStreetMap Mapnik layer. | ||
| + | var layerMapnik = new OpenLayers.Layer.OSM(" | ||
| + | layerMapnik.transitionEffect = " | ||
| + | layerMapnik.isBaseLayer = true; | ||
| + | map.addLayer(layerMapnik); | ||
| + | </ | ||
| ===== Mostrare un mark sulla mappa OSM ===== | ===== Mostrare un mark sulla mappa OSM ===== | ||
tecnica/gps_cartografia_gis/openlayers_900913.1288963393.txt.gz · Last modified: by niccolo
