Changeset 3355
- Timestamp:
- 06/17/07 12:13:20 (1 year ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
sandbox/camptocamp/externalGraphics/examples/vector-features.html
r3276 r3355 1 1 <html xmlns="http://www.w3.org/1999/xhtml"> 2 <head>3 <style type="text/css">2 <head> 3 <style type="text/css"> 4 4 #map { 5 5 width: 800px; … … 8 8 } 9 9 </style> 10 <script src="../lib/OpenLayers.js"></script>11 <script type="text/javascript">10 <script src="../lib/OpenLayers.js" type="text/javascript"></script> 11 <script type="text/javascript"> 12 12 <!-- 13 13 var map; … … 24 24 style_blue.externalGraphic = "../img/marker.png"; 25 25 26 // each of the three lines below means the same, if only one o t26 // each of the three lines below means the same, if only one of 27 27 // them is active: the image will have a size of 24px, and the 28 28 // aspect ratio will be kept … … 43 43 // if graphicWidth and graphicHeight are both set, the aspect ratio 44 44 // of the image will be ignored 45 style_mark.graphicWidth = 24;46 style_mark.graphicHeight = 20;47 48 style_mark.externalGraphic = "../img/marker.png"; 45 style_mark.graphicWidth = 24; 46 style_mark.graphicHeight = 20; 47 48 style_mark.externalGraphic = "../img/marker.png"; 49 49 50 50 var vectorLayer = new OpenLayers.Layer.Vector("Simple Geometry"); … … 91 91 // --> 92 92 </script> 93 </head> 94 <body onload="init()"> 95 <div id="map"></div> 96 <p>This example shows drawing simple vector features -- point, line, polygon 97 in different styles, created 'manually', by constructing the entire style 98 object, via 'copy', extending the default style object, and by 99 inheriting the default style from the layer.</p> 100 </body> 93 </head> 94 <body onload="init()"> 95 <div id="map"></div> 96 <p>This example shows drawing simple vector features -- point, line, 97 polygon in different styles, created 'manually', by constructing the 98 entire style object, via 'copy', extending the default style object, and 99 by inheriting the default style from the layer.</p> 100 <p>It also shows how to use external graphic files for point features 101 and how to set their size: If either graphicWidth or graphicHeight is set, 102 the aspect ratio of the image will be respected. If both graphicWidth and 103 graphicHeight are set, it will be ignored. Alternatively, if graphicWidth 104 and graphicHeight are omitted, pointRadius will be used to set the size 105 of the image, which will then be twice the value of pointRadius with the 106 original aspect ratio.</p> 107 </body> 101 108 </html>
