I have a map which has a Selector for a map control which lets the
user select which area of the map to look at. Here's the link:
http://members.bellatlantic.net/~vze2h6gy/papabear/BM_Station_GMap.html#FILE=EOA_Entire.js&segment=7&index=triangle&title=1&t=ter&width=960&height=720
When you bring up the map, notice that there are a set of points
connected by lines, and the lines continue off the map. As you drag
themap along, these other lines continue (in this case up and down the
east coast of the US).
Now click on the Selector under the zoom buttons on the upper left,
and you will see a list of areas along the east coast. Click on one
of these and the new area will be brought into the viewport and the
points where the lines intersect will now have icons and labels,.
This all work just fine.
But, one can also move to adjacent areas, (or to any area visible at
wide enough zoom) but clicking on any of the lines in that non-
selected area. If you do that, the map will recenter on the new area
and the icons and labels for that area will appear, just as if you had
used the selector control. So using the Selector control, or clicking
on the map both perform equivalent functions.
Problem: in Firefox, the name in the selector control is not updated
when you use the map-click method of going to a new area. In IE,
Chrome or Safari the name is updated.
For example, when you first bring up the map, if you click in the area
of green lines at the upper right of the map (around Bridgeport
Connecticut) and follow the link in the infowindow, the map will shift
to that new area around Bridgeport. In IE, Chrome or Safari, the
Selector control will also get updated so it will now say "Fire Is.
Base". But in Firefox, it will not get updated and it will still say
"Mid-Atlantic".
The Selector Map control is defined in the main routine and it is a
function as follows:
function SegmentSelectControl() {}
SegmentSelectControl.prototype = new GControl();
SegmentSelectControl.prototype.initialize = function(map) {
var segment_selector = document.createElement("select");
...
GEvent.addDomListener(segment_selector, "change", function(){
goToSegment(segment_selector.selectedIndex);
...
}
The function that moves you to a new area (called by the event
listener) is as follows:
function goToSegment(index) {
...
map.setCenter(center_point, zoomlevel);
map.clearOverlays();
addTriangles();
segment_selector.selectedIndex = index;
}
The last line of that function updates the selector - but not in
Firefox.
Sorry for the code snippets, if you like, just look at the code - it's
all there.
Any help would be much appreciated.
Thanks
Richard aka Papa Bear
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/Google-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---