On Dec 2, 7:41 am, "[email protected]"
<[email protected]> wrote:
> Larry
>
> my intent is to allow multiple markers on the map at the same time. i
> want the onclick event of a give lat,lng pair to toggle that specific
> marker.

It would be simpler if you kept a reference to the marker (in a
gmarkers array like Mike Williams does in some of his tutorials).
Then the "click" on the sidebar would have a reference that it could
use and you could use GMarker.show() and GMarker.hide().  Clicking on
the marker or sidebar could hide it.

If you really want to do it by lat/lng; I would still keep an array of
markers that have been added to the map, then the plotMarker routine
would iterate through the array looking for GMarkers within a small
distance of the specified lat/lng and if it finds and, remove them,
otherwise add the marker.

You probably want to be careful about expecting the latitude and
longitude to be exactly the same, they are floating point numbers.

  -- Larry

>
> On Dec 1, 11:03 pm, "[email protected]" <[email protected]>
> wrote:
>
>
>
> > On Dec 1, 7:55 pm, "[email protected]" <[email protected]>
> > wrote:
>
> > > On Dec 1, 7:28 pm, "[email protected]"
>
> > > <[email protected]> wrote:
> > > > the map can be found 
> > > > athttp://cert.digitalmedia-llc.net/clients/FLVacations_info/florida-des....
>
> > > > i am trying to create a toggle affect, where an onclick event will
> > > > create the marker and a second onclick event will remove the marker. i
> > > > cant figure out how to implement the removeOverlay method to remove
> > > > the marker once it has been plotted.
>
> > > I get a javascript error on that page in IE6:
> > > Line: 15
> > > Error: Object doesn't support this property or method
>
> > > on this line:
> > >     map = new GMap2(document.getElementById('map'));
>
> > > because you didn't declare your map variable (for IE you need a "var
> > > map" somewhere for javascript variables that have the same name as
> > > divs in the DOM).
>
> > > You probably want to make it global.
>
> > Your marker variable should also be a GMarker, not a GLatLng, and will
> > may need to be global as well.  Is your map only going to show one
> > marker at a time?  If they click on a different one, should the old
> > marker disappear and the new one appear?
>
> >   -- Larry
>
> > >   -- Larry- Hide quoted text -
>
> - Show quoted text -

--

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