I'm making a simple http server and I want to add a world map feature, that displays client geo location.
I got two questions:
Is there a way to find out lat/lon of an IP address without using sites like ip2location.com?
How can I geographically display a point on an image(world map) with giving lat,lon as an input parameter? is there a formula for that?
Thanks!
Is there a way to find out lat/lon of an IP address without using sites like ip2location.com?
No, unless you create and host your own database.
How can I geographically display a point on an image(world map) with
giving lat,lon as an input parameter? is there a formula for that?
Both Google and Bing Maps provide such functionality. Here's an example with Google Maps which allows you to place markers on a map given their latitude and longitude.
UPDATE:
You could use a Mercator Projection to place a point given latitude and longitude. You may take a look at the following article which explains the technique.
Related
I am working on a Xamarin iOS project trying to display a list of the most likely locations based on the user's GPS coordinates using either the Place Picker or GMSPlacePickerViewController from the google maps API, as shown in this Swift tutorial.
However I can't seem to find any decent tutorials using C#. I don't want to display the map to users I simply want to retrieve the list of most likely locations based on the coordinates.
Any guidance would be greatly appreciated as I'm at a bit of a loss about how to use the google maps API to achieve this.
Okay answering this for anyone coming after me and trying to do something similar.After lots of searching I have realised it is possible to use the nearbySearch method from the Google Places API Web Service to retrieve a list of addresses near particular coordinates within a specific radius (in metres). You can optionally specify the type of addresses you are searching for, e.g. Restaurants.
Not sure how I missed this but there is a Place Search demo at the bottom of this page;
https://developers.google.com/places/web-service/
I'm building an application and I need to get the coordinates based on address, so I'm planning to use the Google Geocoding API. As I read in the Geocoding reference https://developers.google.com/maps/articles/geocodestrat I may store the data to avoid exceed the limit.
However, my application it's not a map based, I mean, has no map in my application and I just need the coordinates (latitude and longitude) to fulfill an own system that get some store information within a radius from coordinates.
Could I use the Google Geocoding API for this purpose? Is it allowed by licensing?
10.1.1 (h) No Use of Content without a Google Map. You must not use or display the Content without a corresponding Google map, unless you are explicitly permitted to do so in the Maps APIs Documentation. In any event, you must not use or display the Content on or in conjunction with a non-Google map. For example, you must not use geocodes obtained through the Service in conjunction with a non-Google map. As another example, you must not display Street View imagery alongside a non-Google map, but you may display Street View imagery without a corresponding Google map because the Maps APIs Documentation explicitly permits you to do so.
https://developers.google.com/maps/terms
Though the general terms disallow use of content without a Google map, I think the specific terms for the Geocoding API permit it.
The following terms apply only to the Geocoding API:
3.1 Use without a Google Map. Customer may use Google Maps Content from the Geocoding API in Customer Applications without a corresponding Google Map.
Source: https://cloud.google.com/maps-platform/terms/maps-service-terms#3.-geocoding-api
I am looking for the ability in C# .Net to find the address from an array of Latitudes and Longitudes. My array would have something like the following (39.96481959995778, -83.00803899765015),(39.96575701532093, -83.00681591033936). From the coordinates i would get back all the address within that area. i appreciate any help with this.
This is called as Reverse-GeoCoding. You need to use a third party webservice (free or paid) that returns the user addresses on the basis of Lat/Long. Google has one like this See this on how to use google for this purpose.GEO CODING but there are other such services as well. You find one that is right for you. If you are using it in a commercial environment i guess you will have to purchase a license for that.
I am trying to code pathfinding algorithm by using Google Maps Api.
The project is an ASP.Net Web Application and I must get the shortest way between A and B but it is my job not Google Maps'.
I only need to ask Google Maps "Hey Google Is there a direct road between X and Y?" then need boolean type simple answer. (There is always a road between X and Y indirectly so Google Maps can say me the distance of road/path it is acceptable for me too).
My other question is "Is there any library for .Net to not need to use javascript or at least using javascript strings on .cs files not in aspx files?"
Thanks in advance and forgive me about my bad English.
For calculating route between two points you need Google Directions API. That will return you a result json/xml with distance and other details.
The Google Directions API is a service that calculates directions
between locations using an HTTP request. You can search for directions
for several modes of transportation, include transit, driving, walking
or cycling. Directions may specify origins, destinations and waypoints
either as text strings (e.g. "Chicago, IL" or "Darwin, NT, Australia")
or as latitude/longitude coordinates. The Directions API can return
multi-part directions using a series of waypoints
A request would be something like
http://maps.googleapis.com/maps/api/directions/json?origin=Boston,MA&destination=Concord,MA&waypoints=Charlestown,MA|Lexington,MA&sensor=false
You may wanna see this article on Code project: Google Maps API V3 for ASP.NET
For your 2nd part of the question, I am not sure what are you asking. You can use the above API in .Net irrespective of JavaScript
We're trying to import a file from a C# dll into MapPoint, and can get it to read the data just fine, but we are having trouble with MapPoint not recognizing all of the addresses. Currently, our file contains not only address information, but latitude and longitude as well (under the headers of Lat and Lon). Is there any options we can set, or any methods we can use that will allow us to tell MapPoint to use the latitude and Longitude in place of, or in addition to the address? So far I've not found any, but I could be looking in the wrong place anyway. Thanks.
You should be able to locate Location objects by Latitude, Longitude coordinates, and to locate input data (eg. from Excel or Access) using Longitude,Latitude coordinates. How are you actually creating the data in MapPoint?
Richard
Map Point 2010 will allow you to enter a Location based on Longitude and Latitude. Are you using the Web Based Bing API or the Map Point application API? I am using this same functionality in one of my applications. If you are using the application API, the ShowFindDialog method will even throw up a pre-rolled window with search criteria for a location, and you can enter latitude and longitude there. See the MSDN article if you have detailed questions. http://msdn.microsoft.com/en-us/library/aa562422.aspx