well chad, some approval from you makes me happy =) thx a lot!

and yea you are right , the click/dblclick propagating (its even worse
with a singel click, thats why i used the double click) with the map
but i dont see how a flag should remove the problem because the
movment seems triggert by the infowindow.close(map,this); you know iam
saying

you think i could use a rightclick with a div to delete the marker and
do the rest? seems more logic for me anyway... is there somewhere an
example ?

ill try the marker storage method you mentiont, we´ll see

thx a lot !

On Oct 28, 5:53 pm, Chad Killingsworth
<chadkillingswo...@missouristate.edu> wrote:
> Nice use of the API.
>
> Determining the Marker: If you wrap the marker inside another object,
> you can store extra information safely. Something like:
>
> function MyMarker(id, markerOpts)
> {
>   this.id = id;
>   this.marker = new google.maps.Marker(markerOpts);
>
> }
>
> var marker1 = new MyMarker(1, {my marker options});
> alert(marker1.id);
>
> As for the map moving when you delete a marker, I'm guessing that a
> click (or double click) event is propagating up to the map. You could
> set a flag in removeMarker and if that flag is set, ignore the event
> (and reset the flag) in the matching event on the map.
>
> Chad Killingsworth
>
> On Oct 28, 10:19 am, en4ce <djen...@googlemail.com> wrote:
>
> > hi
>
> > i have 2 questions regarding erasing markers
>
> > 1. when i click a marker, am i able to determinate what marker i
> > clicked id wise (the markers are stored in a markers[] array)  is
> > there a method like marker.getId() ? i didn't found something simular
> > so i worked a sloppy way around and its not working very good :/
>
> > 2. to delete a marker my users are forced to click on a marker and a
> > Infowindow open, in this infowindow is a link with a remove function.
> > the function look like this:
> > function removeMarker(markercnt) {
> >      infowindow.close(map,this);
> >      markercount--;
> >      markers[markercnt].setMap(null);
> >      markers.splice(val, 1);
> >      updateElevation();
> >      closeShareLocalinfo();
> >   }
> > well, the marker gets deleted and the polylines get redrawn, that
> > works well but, after the " infowindow.close(map,this);" the maps
> > jumps to another view point (usually like a few km above) and this is
> > really nasty... anyone have an idea why this happens ?
>
> > you can test it online under:  www.youspots.com/beta, klick on Share
> > Spots in the left menu and draw more then 2 markers... click the 3rd++
> > + marker and click on the marker and double click on the link, you´ll
> > see that behavior.
> > somehow, after the infowindow is closed, the map do a center to
> > another position... now after a few hours trying to figure the problem
> > out i ask for help...
>
> > you can see the js file who handles all the stuff 
> > here:http://youspots.com/beta/conf/js/mapsapiconfV2.js
>
> > any input is apreciated
> > best regards, en4ce

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps JavaScript API v3" group.
To post to this group, send email to google-maps-js-api...@googlegroups.com.
To unsubscribe from this group, send email to 
google-maps-js-api-v3+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-maps-js-api-v3?hl=en.

Reply via email to