Before I hack this one out, I'm curious if anybody thinks there is a
'best practice' for the following scenario.
I've got 4 'static' layers, and one, of three possible 'dynamic' layers.
The dynamic/animated layer's source can
be toggled by the user with a radiobutton dialog, and one of the three
dynamic layers may be loaded depending on user preference.
I was using some code like this for MapPane:
===============================================
var imgDivId =
config.objects.mainMapWidget.getLayerDivId(currentAnimatedLayerName);
var imgDiv = document.getElementById(imgDivId);
var newImgDivId =
config.objects.mainMapWidget.getLayerDivId(selectedLayerName);
imgDiv.id = newImgDivId;
var src = imgDiv.firstChild.src;
// Change active layer
var newSrc =
imgDiv.firstChild.src.replace(/LAYERS\=[A-Za-z0-9]*\&/,'LAYERS=' +
newLayerName + '\&');
imgDiv.firstChild.src = newSrc;
===============================================
Basically, get the img div, and replace the source on the URL to reflect
the new preferred layer. I know this is kind of
'hackish', but it worked rather well.
So, we've got MapPaneOL now, and (not surprisingly) getLayerDivId
doesn't work. I'll have to rethink this code somewhat.
I was thinking that I could do something like:
=============================================
objRef.oLlayers[layerName].mergeNewParams({"NAME":newLayerName});
=============================================
Is there a 'best practice' recommended for this?
Matthew D. Diez
IEM CONFIDENTIAL INFORMATION PLEASE READ OUR NOTICE:
http://www.iem.com/e_mail_confidentiality_notice.html
Effective July 15, 2007 IEM Headquarters will have a new physical and mailing
address:
8550 United Plaza Blvd, Suite 501
Baton Rouge, LA 70809
If you should have any questions, please feel free to contact us at 225.952.8191
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
mapbuilder-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mapbuilder-devel