[OpenLayers-Users] baseLayers visibility question

mikani gina.m.dang at lmco.com
Wed Sep 23 12:25:58 EDT 2009


Hi I have a map in a form, and am submitting the map, and depending the layer
that's checked from layerswitcher, I'd like to display selected map after
submit.

Any idea how I can do this?
I tried setVisibility(true) after submit, and think that can do the trick,
but I'm having a hard time getting the BaseLayers info.
By default, i see form submits "...&baseLayers=Google+Streets",
is there a way i can grab baseLayer by name?
Thank you for any help! 

my sample code:
var selectedlayer = document.searchform.selectedlayer;

if (baselayer.length > 0)
	{
		//map.setBaseLayer(selectedlayer[1]);

		layer.setVisibility(true);
		alert('baselayerlength: '+baselayer.length +'baselayer:
'+baselayer[1].visibility);
	}
else {alert("not found");} 

-- 
View this message in context: http://n2.nabble.com/baseLayers-visibility-question-tp3700787p3700787.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.



More information about the Users mailing list