NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

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's gravatar image

Brainie
11112
accept rate: 0%

edited 25 Mar '15, 21:44

SimonPoole's gravatar image

SimonPoole ♦
44.7k13326701

about which "pin" are you talking? in a specific program/website?

(24 Mar '15, 20:22) aseerel4c26 ♦

ta - by pin - I mean the image (marker.png) which shows the location on the map (is there a technical term for this?)

(25 Mar '15, 09:39) Brainie

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.

(25 Mar '15, 21:02) aseerel4c26 ♦

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

permanent link

answered 25 Mar '15, 10:53

escada's gravatar image

escada
19.0k16166302
accept rate: 21%

edited 25 Mar '15, 21:07

aseerel4c26's gravatar image

aseerel4c26 ♦
32.6k18248554

That sounds hopefuly, thank you very much.

(25 Mar '15, 13:31) Brainie

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

permanent link

answered 25 Mar '15, 08:28

escada's gravatar image

escada
19.0k16166302
accept rate: 21%

edited 25 Mar '15, 08:29

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

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!

permanent link

answered 20 Oct '22, 06:47

torres187's gravatar image

torres187
111
accept rate: 0%

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×535
×113
×98
×60

question asked: 24 Mar '15, 19:45

question was seen: 7,865 times

last updated: 20 Oct '22, 06:47

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum