[OpenLayers-Commits] r2326 - sandbox/vector-2.4/examples
commits at openlayers.org
commits at openlayers.org
Mon Mar 5 12:51:03 EST 2007
Author: crschmidt
Date: 2007-03-05 12:51:02 -0500 (Mon, 05 Mar 2007)
New Revision: 2326
Added:
sandbox/vector-2.4/examples/vector-testing.html
Log:
Test file for the vector layer. When this file works, we can all go home
for the day ;) (Not quite, but the goal for today is to get the vector layer
working with a solid API, then move on to controls/editing/mouse/etc.)
Copied: sandbox/vector-2.4/examples/vector-testing.html (from rev 2311, sandbox/vector-2.4/examples/lite.html)
===================================================================
--- sandbox/vector-2.4/examples/vector-testing.html (rev 0)
+++ sandbox/vector-2.4/examples/vector-testing.html 2007-03-05 17:51:02 UTC (rev 2326)
@@ -0,0 +1,37 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <style type="text/css">
+ #map {
+ width: 800px;
+ height: 475px;
+ border: 1px solid black;
+ }
+ </style>
+ <script src="../lib/OpenLayers.js"></script>
+ <script type="text/javascript">
+ <!--
+ var lon = 5;
+ var lat = 40;
+ var zoom = 5;
+ var map, layer;
+
+ function init(){
+ map = new OpenLayers.Map( $('map') );
+ layer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
+ "http://labs.metacarta.com/wms/vmap0", {layers: 'basic'} );
+ map.addLayer(layer);
+ v = OpenLayers.Layer.Vector("Boston -> Barcelona");
+ boston = new OpenLayers.Geometry.Point(-71,42);
+ barcelona = new OpenLayers.Geometry.Point(7,42);
+ line = new OpenLayers.Geometry.LineString([boston,barcelona]);
+ f = new OpenLayers.Feature.Geometry(line);
+ v.addFeatures([f]);
+ map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);
+ }
+ // -->
+ </script>
+ </head>
+ <body onload="init()">
+ <div id="map"></div>
+ </body>
+</html>
More information about the Commits
mailing list