tecnica:gps_cartografia_gis:openlayers_tips
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
tecnica:gps_cartografia_gis:openlayers_tips [2011/07/19 18:27] – [Click destro] niccolo | tecnica:gps_cartografia_gis:openlayers_tips [2012/06/21 11:06] – [OpenLayers, ricette e trucchi] niccolo | ||
---|---|---|---|
Line 6: | Line 6: | ||
* [[http:// | * [[http:// | ||
* [[http:// | * [[http:// | ||
+ | * [[http:// | ||
===== Layer supportati da OpenLayers ===== | ===== Layer supportati da OpenLayers ===== | ||
Line 235: | Line 235: | ||
il **rettangolo che evidenzia l' | il **rettangolo che evidenzia l' | ||
- | ===== Sistemi di riferimento ===== | + | ===== Sistemi di riferimento |
OpenLayers supporta alcuni sistemi di riferimento, | OpenLayers supporta alcuni sistemi di riferimento, | ||
Line 246: | Line 246: | ||
<code html> | <code html> | ||
<script type=" | <script type=" | ||
+ | <script type=" | ||
+ | <script type=" | ||
<script type=" | <script type=" | ||
</ | </ | ||
- | In teoria OpenLayers dovrebbe scoprire automaticamente che è disponibile la libreria proj4js, ma non è chiaro come. | + | In teoria OpenLayers dovrebbe scoprire automaticamente che è disponibile la libreria proj4js, |
- | Sistemi di riferimento aggiuntivi | + | Sistemi di riferimento aggiuntivi |
+ | |||
+ | Ecco ad esempio il file **'' | ||
<code javascript> | <code javascript> | ||
Line 259: | Line 263: | ||
</ | </ | ||
- | Se non si aggiunge manualmente la definizione, proj4js tenta di scaricarla da spatialreference.org. L' | + | Dopo aver incluso il JavaScript di cui sopra, diventa possibile fare operazioni del tipo: |
+ | |||
+ | <code javascript> | ||
+ | var lonLat = new OpenLayers.LonLat(1554000, | ||
+ | alert(" | ||
+ | lonLat.transform(new OpenLayers.Projection(' | ||
+ | alert(" | ||
+ | </ | ||
+ | |||
+ | :!: **ATTENZIONE!** | ||
===== i18n ===== | ===== i18n ===== | ||
Line 305: | Line 318: | ||
if (OpenLayers.Event.isRightClick(e)) { | if (OpenLayers.Event.isRightClick(e)) { | ||
alert(" | alert(" | ||
+ | OpenLayers.Event.stop(e); | ||
return false; | return false; | ||
- | } else { | ||
- | return true; | ||
} | } | ||
} | } | ||
Line 315: | Line 327: | ||
</ | </ | ||
+ | ===== Problema con Layer.Markers e pop-up ===== | ||
+ | |||
+ | Se si disegna un layer di tipo **'' | ||
+ | |||
+ | È possibile anche usare il metodo **'' | ||
+ | |||
+ | <code javascript> | ||
+ | map.addLayer(vectorLayer); | ||
+ | map.raiseLayer(vectorLayer, | ||
+ | </ | ||
+ | Si decrementa di 2 per tenere in conto il layer stesso e un solo baselayer, di 3 se i baselayer sono due, ecc. |
tecnica/gps_cartografia_gis/openlayers_tips.txt · Last modified: 2013/03/18 16:25 by niccolo