latitude-longitude

Is it possible to get the latitude and longitude of a draggable marker in a map (using javascript) into a form in HTML?

别说谁变了你拦得住时间么 提交于 2019-11-27 08:35:05
问题 I am trying to obtain the Latitude and longitude of a draggable marker in google maps. I need this values to go directly into the value attribute in an <input type="text"> . I've managed to do this, the only problem is that I don't know how to add a geocoder so the user can type their own address and get the lat and lng, but they also need to be albe to drag the marker in case google maps isn't accurate. I'll put my code down here. Appreciate if anyone could help. HTML <!DOCTYPE html> <html>

Moving a CLLocation by x meters

旧城冷巷雨未停 提交于 2019-11-27 07:50:22
I have a CLLocation defined, and I'd like to move that point x meters to the east and y meters to the south. How may I achieve that? There is a C function that is close to what you are asking but it takes a bearing and distance. It's in my UtilitiesGeo class on github . You would pass the latitude and longitude from your CLLocation to it and then create a new CLLocation from the resulting lat2 and lon2 that it returns: /*------------------------------------------------------------------------- * Given a starting lat/lon point on earth, distance (in meters) * and bearing, calculates destination

Lat Long to Minutes and Seconds?

♀尐吖头ヾ 提交于 2019-11-27 07:44:19
问题 Google Maps gives me the Lat and Long of a location in decimal notation like this: 38.203655,-76.113281 How do I convert those to Coords (Degrees, Minutes , Seconds) 回答1: 38.203655 is a decimal value of degrees. There are 60 minutes is a degree and 60 seconds in a minute (1degree == 60min == 3600s). So take the fractional part of the value, i.e. 0.203655, and multiply it with 60 to get minutes, i.e. 12.2193, which is 12 minutes, and then repeat for the fractional part of minutes, i.e. 0.2193

Calculating the distance between points in different data frames

∥☆過路亽.° 提交于 2019-11-27 07:14:05
问题 I am trying to find the distance between points in two different data frames given that they have the same value in one of their columns. I figure the first step is to join or relate the data in the two data frames. For example there is dataframe A and B which both have lat/long information in them and they share the column Name . Note that for a given Name the lat/long information is different in each dataframe. Thats why I want to calculate the distance between them. I envision the final

android google map finding distance

。_饼干妹妹 提交于 2019-11-27 07:11:10
问题 I am trying to find distance between two locations. I have longitudes and latitudes and I can calculate Euclidean distance. But I want to find road distance. I mean, , I want to calculate the distance of the road that I am going on while going to destination from source. In this case how to calculate this? 回答1: The easiest way would be to use the Google Directions API to get the directions, this gives you a list of all the points along the route (and the total distance). Check out : http:/

Converting Longitude & Latitude to X Y on a map with Calibration points

戏子无情 提交于 2019-11-27 06:49:40
If i have a jpeg map with size sizeX, sizeY and some calibration points on the map (X, Y, Lon, Lat) What would be the algorithm for calculating the corresponding XY point in the map with a given Longitude / Latitude pair? Here's what worked for me, without so much bs. int x = (int) ((MAP_WIDTH/360.0) * (180 + lon)); int y = (int) ((MAP_HEIGHT/180.0) * (90 - lat)); The lat,lon coordinates were given to me by Android devices. So they should be in the same standard used by all Google Earth/Map products. If using the Equidistant Cylindrical Projection type map , here is what you need to do: Find

Get latitude and longitude based on location name with Google Autocomplete API

拜拜、爱过 提交于 2019-11-27 06:23:23
I have a textbox in my page which gets a location name and button with text getLat&Long . Now on clicking my button I have to show an alert of latitude and longitude of the location in the textbox. Any suggestion? You can use the Google Geocoder service in the Google Maps API to convert from your location name to a latitude and longitude. So you need some code like: var geocoder = new google.maps.Geocoder(); var address = document.getElementById("address").value; geocoder.geocode( { 'address': address}, function(results, status) { if (status == google.maps.GeocoderStatus.OK) { // do something

3D coordinates on a sphere to Latitude and Longitude

孤者浪人 提交于 2019-11-27 06:19:29
I've got the following information: There exists a sphere with origin (0,0,0) and radius R. After doing a ray-sphere intersection I know a point (XYZ) in 3D space that is on the sphere (the exact position in 3D space where the line pierces the sphere hull). For my program I'd like to calculate the Latitude and Longitude of the XYZ point on the sphere, but I can't think (or Google) up a way to do this easily. So in short, the function that I'm trying to write is this: public static LatLon FromVector3(Vector3 position, float sphereRadius) { return Latitude and Longitude } Does anybody know how

What's the best way to store co-ordinates (longitude/latitude, from Google Maps) in SQL Server?

亡梦爱人 提交于 2019-11-27 06:17:22
I'm designing a table in SQL Server 2008 that will store a list of users and a Google Maps co-ordinate (longitude & latitude). Will I need two fields, or can it be done with 1? What's the best (or most common) data-type to use for storing this kind of data? Craig Bovis Take a look at the new Spatial data-types that were introduced in SQL Server 2008. They are designed for this kind of task and make indexing and querying much easier and more efficient. More information: MS TechNet: SQL Server 2008 Spatial Data Types , MSDN: Working with Spatial Data (Database Engine) . dan90266 Fair Warning!

Latitude, Longitude Grabber

夙愿已清 提交于 2019-11-27 06:13:17
问题 What I would like to do is create app where when anyone clicks on the map object and two fields get filled with latitude and longitude at every click. Is there sample code of Google Maps V3 JavaScript API (Geocoding API) somewhere out there that does something like that? 回答1: You can achieve this with google.maps.event' LatLng property: Something like this would show how it works. Here is a JSFiddle Demo: google.maps.event.addListener(map, 'click', function(event){ alert('Lat: ' + event