[OpenLayers-Users] Help adding WMS on openstreetmap
brentgraham40
brentgraham40 at hotmail.com
Sat Oct 1 20:52:07 EDT 2011
I am using the mobile map example and need some help adding a wms overlay on
top of the open street map layer. I tried to add a wms layer after the
layers: [
new OpenLayers.Layer.OSM("OpenStreetMap", null, {
transitionEffect: 'resize'
}), var wms = new OpenLayers.Layer.WMS(
"OpenLayers WMS",
"http://vmap0.tiles.osgeo.org/wms/vmap0",
{'layers':'basic'} );
map.addLayer(wms);
but it didn't work... Can someone please help me add a wms overlay?
Thanks...
// initialize map when page ready
var map;
// Get rid of address bar on iphone/ipod
var fixSize = function() {
window.scrollTo(0,0);
document.body.style.height = '100%';
if (!(/(iphone|ipod)/.test(navigator.userAgent.toLowerCase()))) {
if (document.body.parentNode) {
document.body.parentNode.style.height = '100%';
}
}
};
setTimeout(fixSize, 700);
setTimeout(fixSize, 1500);
var init = function () {
// create map
map = new OpenLayers.Map({
div: "map",
theme: null,
controls: [
new OpenLayers.Control.Attribution(),
new OpenLayers.Control.TouchNavigation({
dragPanOptions: {
enableKinetic: true
}
}),
new OpenLayers.Control.ZoomPanel()
],
layers: [
new OpenLayers.Layer.OSM("OpenStreetMap", null, {
transitionEffect: 'resize'
})
],
center: new OpenLayers.LonLat(-83,39),
zoom: 6
});
};
--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Help-adding-WMS-on-openstreetmap-tp6851710p6851710.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
More information about the Users
mailing list