Link removed
This is my site. Im working on so you can enter a location on the search input field, and then see theres xx km from a restaurant.
Now i got almost everything working. If you see the source code you can see how it works. It showAddress(what you searched). And then show addresses makes it into lat/lng cords, and pass it to computeRestaurants() which computes the distances between the location you entered and the restaurants.
Somehow, when I run:
computeRestaurants(new google.maps.LatLng(55.662133, 12.508028));
outside the functions, it works and gives correct values.
But when i do:
showAddress('Valby'); // (like in the source code)
You can see that it returns NaN. And inside showAddress() it executes the same command as the one i wrote above computeRestaurants( the point )
So why will it not work properly?
point
in showAddress is: (55.662133, 12.508028)
so it is already converted to LatLng cords and therefore no need to new google.maps.latlng(...
My only bet right now is the brackets () ??