3 This probably needs to be renamed index.html for deployment.
4 Specifically, it needs to be the default page for whatever
9 <!-- this gmaps key generated for http://openlayers.org/dev/ -->
10 <script src='http://maps.google.com/maps?file=api&v=2&key=ABQIAAAA9XNhd8q0UdwNC7YSO4YZghSPUCi5aRYVveCcVYxzezM4iaj_gxQ9t-UajFL70jfcpquH5l1IJ-Zyyw'></script>
11 <!-- Localhost key -->
12 <!--<script src='http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAjpkAC9ePGem0lIq5XcMiuhT2yXp_ZAY8_ufC3CFXhHIE1NvwkxTS6gjckBmeABOGXIUiOiZObZESPg'></script>-->
13 <script src="http://openlayers.org/dev/lib/OpenLayers.js"></script>
18 OpenLayers.ProxyHost = '/proxy/?url=';
19 if (document.location.protocol != "file:") {
20 theArgs = OpenLayers.Util.getArgs();
23 theArgs.center = "0,0";
25 theArgs.data = "textfile.txt";
26 theArgs.controls = 'panzoom,mouse';
27 theArgs.layers = 'openlayers';
32 // TODO: Handle all this parsing better.
37 var DEFAULT_ZOOM_LEVEL = 0;
38 var DEFAULT_CONTROLS = ['panzoom','mouse'];
39 var DEFAULT_LAYERS = ['openlayers'];
44 safeArgs.centerLat = theArgs.center ?
45 parseFloat(theArgs.center.split(",")[IDX_LAT]) : DEFAULT_LAT;
47 safeArgs.centerLon = theArgs.center ?
48 parseFloat(theArgs.center.split(",")[IDX_LON]) : DEFAULT_LON;
50 safeArgs.zoom = theArgs.zoom ? parseInt(theArgs.zoom) : DEFAULT_ZOOM_LEVEL;
52 safeArgs.controls = theArgs.controls ?
53 theArgs.controls.split(",") : DEFAULT_CONTROLS;
55 safeArgs.layers = theArgs.layers ?
56 theArgs.layers.split(",") : DEFAULT_LAYERS;
58 safeArgs.data = theArgs.data; // TODO: Make this "safe".
59 safeArgs.marker = theArgs.marker; // TODO: Make this "safe".
62 var theMVS = new OpenLayers.Map('map', {controls: [], maxResolution: 'auto'});
63 for(var i = 0; i < safeArgs.controls.length; i++) {
64 switch(safeArgs.controls[i]) {
66 theMVS.addControl(new OpenLayers.Control.PanZoomBar());
69 theMVS.addControl(new OpenLayers.Control.PanZoom());
72 theMVS.addControl(new OpenLayers.Control.LayerSwitcher());
75 theMVS.addControl(new OpenLayers.Control.MouseDefaults());
79 for(var i = 0; i < safeArgs.layers.length; i++) {
80 switch(safeArgs.layers[i]) {
83 new OpenLayers.Layer.WMS( "OpenLayers WMS",
84 "http://labs.metacarta.com/wms/vmap0",
90 new OpenLayers.Layer.WMS("NASA Mosaic",
91 "http://t1.hypercube.telascience.org/cgi-bin/landsat7",
92 {"EXCEPTIONS" : "application/vnd.ogc.se_inimage",
93 "format" : "image/jpeg",
99 new OpenLayers.Layer.Google( "Google" , {type: G_HYBRID_MAP })
104 theMVS.setCenter(new OpenLayers.LonLat(safeArgs.centerLon, safeArgs.centerLat), safeArgs.zoom);
106 if (safeArgs.marker) {
107 var m = new OpenLayers.Layer.Markers("Marker");
108 m.addMarker(new OpenLayers.Marker(new OpenLayers.LonLat(safeArgs.centerLon, safeArgs.centerLat)));
112 theMVS.addLayer(new OpenLayers.Layer.Text("Data", {location: safeArgs.data}));
118 <body style="margin:0px;"
121 style="width: 100%; height: 100%;
122 background: lightyellow;