How to get location latitude and longitude by address in javascript

<!DOCTYPE html>
<script type=”text/javascript” src=””></script&gt;
<script type=”text/javascript”>

var geocoder = new google.maps.Geocoder();
var address = “נמל תל אביב”;

geocoder.geocode( { ‘address’: address}, function(results, status) {

if (status == google.maps.GeocoderStatus.OK) {
var latitude = results[0];
var longitude = results[0].geometry.location.lng();
alert(“lat : “+latitude + ” long : “+longitude);

This entry was posted in כללי and tagged , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s