this is the link to my code http://www.rstsolutions.co.uk/test3.php
basically i want the code to say that if the lat and long of the address are within an area then we deliver, if not we dont. The top section of the code is working so far but the bottom doesnt, i want the user to be able to click their location on the map and get a message saying whether delivery is available to the area or not. Any help you guys can give me will be greatly appreciated, cheers On Oct 9, 11:06 am, Andrew Leach <[email protected]> wrote: > On Oct 9, 10:06 am, CIARAN <[email protected]> wrote: > > > if (point.lat,point.lng).distanceFrom(55.010455,-7.317671) < 5 > > There are a number of things wrong with this. > > Co-ordinates need to be GLatLng objects, not numbers surrounded by > brackets. The distance is given in metres, not miles. The "if" > condition needs to be completely enclosed in brackets too: you should > have got a syntax error flagged in your browser for that. And I'm not > sure where "document.write" is to write to; that may not work either. > Did you mean "alert"? > > point is already a GLatLng object, so you could do > > var myLocation = new GLatLng(55.010455,-7.317671); > if (point.distanceFrom(myLocation) < 8047) > > And yes, a link to failing code is definitely to be preferred, > although glaring errors in a small amount of code can sometimes be > spotted "by hand". There's no guarantee the above analysis is complete > though, which is why the posting guidelines ask for a link. > > Andrew --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
