finally, i got it :) (pure luck actually, but who cares!)

this is what i've done the the GEvent.addListener

==============================================

                                GEvent.addListener(map, 'click',
function(overlay, point) {

                                if (!overlay) {
                                  for (var i=0; i<polys.length; i++) {
                                    if (polys[i].Contains(point)) {

                                            if (overlay) {

 
map.removeOverlay(overlay);

                                            } else if (point) {
                                                if (marker) {
 
map.removeOverlay(marker);

 
map.recenterOrPanToLatLng(point);
                                                marker = new
GMarker(point, user_icon);

 
map.addOverlay(marker);

                                                                var matchll = 
/\(([-.\d]*), ([-.
\d]*)/.exec( point );

                                                                if ( matchll ) {
                                                                        var lat 
=
parseFloat( matchll[1] );
                                                                        var lon 
=
parseFloat( matchll[2] );
                                                                        lat = 
lat.toFixed(6);
                                                                        lon = 
lon.toFixed(6);

                                                                } else {

                                                                }

 
document.getElementById('spot_lat').value = lat;
 
document.getElementById('spot_lon').value =
lon;

                                                } else {

 
map.recenterOrPanToLatLng(point);
                                                marker = new
GMarker(point, user_icon);

 
map.addOverlay(marker);

                                                                var matchll = 
/\(([-.\d]*), ([-.
\d]*)/.exec( point );

                                                                if ( matchll ) {
                                                                        var lat 
=
parseFloat( matchll[1] );
                                                                        var lon 
=
parseFloat( matchll[2] );
                                                                        lat = 
lat.toFixed(6);
                                                                        lon = 
lon.toFixed(6);

                                                                } else {

                                                                }

 
document.getElementById('spot_lat').value = lat;
 
document.getElementById('spot_lon').value =
lon;

                                                }


                                                        }

                                      i = 999;

                                    }
                                  }
                                }
                                });
================================================

just added another check for the marker, and declared the marker as a
global variable, and voila, it worked. don't know if this is straight
forward thinking, even if this is real programming, but as i said, who
cares... as long as it does the job !!!

thank u again for all your help :)

Jan

-- 
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