• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 459
  • Last Modified:

Where i can get data of location by Latitude and Longitude without google map

I have data Latitude,Longitude  . and i want to get location without use javascript to get address from google map. can i do that ? or there is some where that i can get all  address data with Latitude,Longitude. so  i will get address only my country then save to database. then when i want to use location i just pull data by Latitude,Longitude from my database .

or any one have another idea
0
aimds
Asked:
aimds
  • 2
  • 2
1 Solution
 
Avinash ZalaWeb ExpertCommented:
try below code:




<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml">
<head>
	<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
	<title>Google Maps JavaScript API Example: Tile Detector</title>
	<script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=Your google map key here" type="text/javascript"></script>
	<script type="text/javascript">
	

	function showAddress(address) {
		
			geocoder = new GClientGeocoder();
		if (geocoder) {
			geocoder.getLatLng(
				address,
				function(point) {
					if (!point) {
						alert(address + " not found");
					} else {
						var latitude = point.lat().toFixed(5);
						var longitude = point.lng().toFixed(5);
					}
				}
			);
		}
	}

	showAddress('uk');
	
</script>

Open in new window

0
 
aimdsAuthor Commented:
How can i do it in window form (my application is window application(c#.net))
and I need to for..loop to get many address
can i do that ?
0
 
aimdsAuthor Commented:
I tried to use webBrowser1.Document.InvokeScript("GetAddress", new object[] { "uk" });
it's work only first time when i call it in event webBrowser1_DocumentCompleted
but i want  to for..loop to get many time
0
 
Avinash ZalaWeb ExpertCommented:
Sorry but i am not ggod at C#.net. But  You can simply create for loop in javascript and call this function like below:

<script>
var addressArray=[];

addressArray[0]='usa';
addressArray[0]='uk';
addressArray[0]='australia';
addressArray[0]='india';
addressArray[0]='south africa';
for(var i=0;i<5;i++)
{
    showAddress(addressArray[i]);
}
</script>


Hope this helps
Addy
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now