I have been looking into getting GPS info from devices and simply displaying a map pin and all - quite simple stuff really. However, I can't help but notice that the "pin" is too often quite a distance from the actual location. I'd therefore like to be able to move the "pin" and retrieve the new longitude/latitude (saved in MySQL for example) for later use. Could somebody please example how this can be achieved (assuming its feasible of course). More details: I'm using a little javascript and PHP to create a simple web page to show "saved locations". The initial location is being captured from a phone or extracted from the JPG/EXIF data, where its saved to a database for future display. However, in the interests of accuracy, I'd like to be able to move this "initial" location and update the long/lat in the database accordingly. Ideally this would be by; viewing the current pined location on a map and allow it to be moved - each move could be used to update longitude and latitude stored in the database. thanks in advance, Brain. asked 24 Mar '15, 19:45 Brainie SimonPoole ♦ |
Assuming you are talking about waypoints created on a GPS device. Most GPS devices will allow you to move the waypoint (aka pin) to a new location. My GPS allows me to move the waypoint on the map or to type in explicit coordinates. I assume that software such as Basecamp (from Garmin) can do the same, once you have downloaded the files to your PC. Of course this approach only works when you are talking about the GPS tracks and waypoint files generated by the GPS device. You can always "move a pin", i.e. change it coordinates, because that is just data in a file or database. The actual solution depends in which file (and where) you have stored your waypoints/pins answered 25 Mar '15, 08:28 escada Ah... OK not quite what the problem, sorry I'll try again. I'm using a little javascript and PHP to create a simple web page to show "saved locations". The initial location is being captured from a phone or extracted from the JPG/EXIF data, where its saved to a database for future display. However, in the interests of accuracy, I'd like to be able to move this "initial" location and update the long/lat in the database accordingly. Ideally this would be by; viewing the current pined location on a map and allow it to be moved - each move could be used to update longitude and latitude stored in the database.
(25 Mar '15, 09:34)
Brainie
|
You could use a JavaScript library (Leaflet, OpenLayers) to display the map and the pins. Those libraries are also capable to convert a mouse click on the map into long/lat, which can then be used to update your data via a call to your server. an example: http://openlayers.org/en/v3.2.1/examples/drag-features.html answered 25 Mar '15, 10:53 escada aseerel4c26 ♦ That sounds hopefuly, thank you very much.
(25 Mar '15, 13:31)
Brainie
|
I was looking for how to extract the coordinates from Google Maps, but now I think it's already paid... It was then that I discovered OpenStreetMap, what I don't know is if you can make this html code work: https://imagesearchreverse.com/get-coordinates-map.html My idea is that the users publish their photos and have the possibility to choose where the photos were taken... If anyone has new information that can help us, I would greatly appreciate it. Either way, I'll keep looking to find and share a solution around here-. Thanks! answered 20 Oct '22, 06:47 torres187 |
about which "pin" are you talking? in a specific program/website?
ta - by pin - I mean the image (marker.png) which shows the location on the map (is there a technical term for this?)
the red one is a bit more frequently (than "pin") called "marker" (as in your image file name). I have added a bit text from your comment below to your question text to clarify it.