this placeMarker(event.latLng); is a function not an array, to fill your placeMarker array use the normal js methods
On 6 Jun., 23:35, a jay <[email protected]> wrote: > hi, i am trying to limit the marker to add only two markers to a map on > click event > i wrote an event listener and added the following code to it: > > GEvent.addListener(map, 'click', function (overlay, latlng) { > if (placeMarker.length < 2) { > pendingLatLng = latlng; > setTimeout("settleClick()", 225) > } > else { > message("You can only select 2 points."); > } > }); > > a sample click event which looks like the line below does work. what am i > doing wrong ?: > google.maps.event.addListener(map, 'click', function (event) > {placeMarker(event.latLng); }) -- 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 [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-js-api-v3?hl=en.
