tecnica:gps_cartografia_gis:openlayers_style
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Last revisionBoth sides next revision | ||
tecnica:gps_cartografia_gis:openlayers_style [2010/01/26 10:27] – niccolo | tecnica:gps_cartografia_gis:openlayers_style [2011/07/15 16:02] – [Utilizzare l'oggetto StyleMap] niccolo | ||
---|---|---|---|
Line 66: | Line 66: | ||
<code javascript> | <code javascript> | ||
- | {{{ | ||
var styleMap = new OpenLayers.StyleMap({ | var styleMap = new OpenLayers.StyleMap({ | ||
" | " | ||
Line 75: | Line 74: | ||
fillColor: " | fillColor: " | ||
}); | }); | ||
- | }}} | + | </ |
+ | |||
+ | ===== Definire lo stile di un Vector layer ===== | ||
+ | |||
+ | Esempio: | ||
+ | |||
+ | <code javascript> | ||
+ | var style = new OpenLayers.Style(); | ||
+ | |||
+ | style.strokeColor = strokeColor; | ||
+ | style.strokeWidth = strokeWidth; | ||
+ | style.strokeOpacity = strokeOpacity; | ||
+ | style.fillColor = fillColor; | ||
+ | style.fillOpacity = fillOpacity; | ||
+ | |||
+ | var vector = new OpenLayers.Layer.Vector(label, | ||
+ | vector.addFeatures( | ||
+ | new OpenLayers.Feature.Vector( | ||
+ | new OpenLayers.Geometry.LinearRing(points_array), | ||
+ | null, | ||
+ | style | ||
+ | ) | ||
+ | ); | ||
</ | </ | ||
tecnica/gps_cartografia_gis/openlayers_style.txt · Last modified: 2011/07/15 16:03 by niccolo