Hi BuckyE
It sounds like we are going about this in broadly similar ways. I have
three different categories of markers are the moment, accommodation,
facilities and mountains. I build an array of marker objects, each
with custom icons and then add them to the map. Mountains outnumber
everything else so they were obscuring the rest. Each mountain has a
custom icon that is coloured to represent height, I want to be able to
toggle them on and off according to height.

The thing that solved the problem for me was the way the parameters
were passed, the thread is here . . .

http://groups.google.ie/group/Google-Maps-API/browse_thread/thread/8c24441de5509a3/ccfe15c167a5e24a?hl=en&lnk=gst&q=alanchard47#ccfe15c167a5e24a

my javascript is not super, so I knew there was something wrong with
the way I created the icons, but not exactly what, the line that
instantiates a new GMarker was

var marker = new GMarker(new GLatLng(43.92,-79.1), iconObjects[1],
{zIndexProcess:importanceOrder});

there are three parameters there, whereas the documentation shows just
two, the first being the point, the second the icon, Esa pointed out
that it should have been

var marker = new GMarker(new GLatLng(43.92,-79.1), {icon: iconObjects
[1], zIndexProcess:importanceOrder});

what it looks like now is that an object literal is created,
containing the icon and the method that sets the zIndex, then this
gets passed as a parameter, well that's my take on it. The detail
might be a little more complex. I copied the tutorial that Mike set up
and put it onto my site, it's still there at http://lakesuk.com/stack/index.htm
with the working code in place. The original tutorial worked fine, it
was the custom icons that messed things up.

I have got most of my sidebar working now, toggling all the markers on/
off is fine, but I've got a messy condition in there that gets it into
a loop, something to do with removing and adding mountain markers, I
may have to put a visible indicator property into each marker, I think
that will be more reliable that tracking the status elsewhere say in
an array. I hope that helps.

Alan



On Feb 24, 3:08 pm, BuckyE <[email protected]> wrote:
> Dear Alan,
> Thank you for the kind words. Of course my page was mostly written
> with code from the gurus here. I've just been cobbling it together,
> and usually had to ask how to make the cobbling work!
>
> I've seen pages where the check boxes are in the sidebar, which looks
> slick at first, but then the boxes often get scrolled down so you
> can't see them. I preferred to leave them in their own table cell at
> top. The actual code that works mine is of course a crib from several
> places. I have a different system working 
> athttp://lovebunnies.luckypro.biz/rioni/
> . You might enjoy looking at that.
>
> I see that you're using the zIndexProcess, and I just added the "var
> b;  // dummy, but needed!" line to my code, but alas, mine still
> doesn't work. I'm at a loss.
>
> I've got a test page almost 
> working:http://lovebunnies.luckypro.biz/01_stuff/roman_holiday/romanholidayma...
>
> I can create two arrays with: "blackandwhitemarkers.push(marker);" and
> "colorrollovermarkers.push(marker);" and mostly successfully hide and
> show the overlays for the individual colorrollovermarkers by referring
> to them as colorrollovermarkers[i].
>
> 1. I tried to make colorrollovermarkers always appear over all
> blackandwhitemarkers using Mike Williams' code for zIndexProcess, but
> mine doesn't do what I had hoped. The colorrollovermarkers are
> interleaved with the blackandwhitemarkers in the normal north-to-south
> way. Ah me. So that's problem number one. Or, is this method of
> "moving a marker to the front" just not going to work?
>
> 2. I tried to add two event listener to the blackandwhitemarkers:
>         GEvent.addListener(marker, "mouseover", function() {
>          map.addOverlay(colorrollovermarkers[i]);
>         });
>         GEvent.addListener(marker, "mouseout", function() {
>          map.removeOverlay(colorrollovermarkers[i]);
>         });
>     The listeners will add and remove the overlay for the second
> marker in the colorrollovermarkers array. Why the second one, I don't
> know. But obviously I need to write a line for a variable (i) = [this
> marker's index number] or something. I've tried about a dozen ways to
> do it and just get errors.
>
> Could you or anyone else tell me where I'm going wrong? Or is this not
> a workable solution to moving a marker to the front?
>
> On Feb 24, 3:18 am, Alan C <[email protected]> wrote:
>
> > HI,
> > very impressive page, I like the way your checkboxes work. I've been
> > working on stacking custom markers, they really are not easy, but I've
> > now got them working (with help from this group). The site is still in
> > development, if you want to look at the stacking of the custom markers
> > it's herehttp://lakesuk.com/index8stacking.php
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to