On Sep 3, 4:21 am, Sumedh <[EMAIL PROTECTED]> wrote: > This is my page... > > http://www.zamanzar.com/listing/loadListProperty > > It has a map... > > I *sometimes* get an error as - > > Error: a is null > Source File:http://maps.google.com/intl/en_ALL/mapfiles/125/maps2.api/main.js > Line: 510 > > Now, right now I am getting this error in the code that is not live > yet...would preferably want to fix the problem before making it > live... > > But the code of the map is same as the link given above... > > Any suggestions? Do I need to put any more info?
A problem is your map click listener. It returns either an overlay or a latlng. If I click on the map (overlay is null, latlng contains the coordinates where I clicked), it adds a marker. If I click on the marker, overlay contains a reference to the marker, latlng is null and your code crashes because null doesn't have a lat() or a lng() method. add a test for latlng before using it (or use the third overlaylatlng parameter, which always contains either the latlng of the clicked point or the latlng of the overlay...) -- Larry --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
