I don't know well enough OpenLayers syntax, so I need to ask here. I need to name every function in OpenLayers (for creating map - tiles, for drawing markers on the map etc.). So, I have this simple code:
map = new OpenLayers.Map('map');
var wms = new OpenLayers.Layer.WMS( "OpenLayers WMS",
"http://vmap0.tiles.osgeo.org/wms/vmap0?", {layers: 'basic'});
I would need to put that inside the function and name that function, something like this:
function createMap() {
map = new OpenLayers.Map('map');
var wms = new OpenLayers.Layer.WMS( "OpenLayers WMS",
"http://vmap0.tiles.osgeo.org/wms/vmap0?", {layers: 'basic'});
}
createMap();
But that code doesn't work. So, can you tell me if this is possible and why my code doesn't work?
Thanks.