[OpenLayers-Commits] r1760 - sandbox/crschmidt/refractions/examples
commits at openlayers.org
commits at openlayers.org
Fri Nov 3 20:12:55 EST 2006
Author: crschmidt
Date: 2006-11-03 20:12:55 -0500 (Fri, 03 Nov 2006)
New Revision: 1760
Modified:
sandbox/crschmidt/refractions/examples/refractions.html
Log:
Add user interface for adding a TMS layer. This will only work for layers
which fit the standard (global?) profile.
Modified: sandbox/crschmidt/refractions/examples/refractions.html
===================================================================
--- sandbox/crschmidt/refractions/examples/refractions.html 2006-11-03 22:02:40 UTC (rev 1759)
+++ sandbox/crschmidt/refractions/examples/refractions.html 2006-11-04 01:12:55 UTC (rev 1760)
@@ -20,12 +20,17 @@
layer = new OpenLayers.Layer.Refractions( "TMS",
"http://labs.metacarta.com/wms-c/tms.cgi/", {layername: 'basic', type:'png'} );
map.addLayer(layer);
+ map.addControl(new OpenLayers.Control.LayerSwitcher());
map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);
}
+ function addTMS() {
+ map.addLayer(new OpenLayers.Layer.Refractions($('layer').value, $('url').value, {layername: $('layer').value, type:$('type').value}));
+ }
// -->
</script>
</head>
<body onload="init()">
+ URL of TMS (Should end in /): <input type="text" id="url" size="60" /> layer_name <input type="text" id="layer" /> <select id="type"><option>png</option><option>jpg</option></select> <input type="submit" onclick="addTMS()"/>
<div id="map"></div>
</body>
</html>
More information about the Commits
mailing list