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 ♦
38.7k13287614

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
17.8k16153283
accept rate: 21%

edited 25 Mar '15, 21:07

aseerel4c26's gravatar image

aseerel4c26 ♦
32.1k16239551

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
17.8k16153283
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
Your answer
toggle preview

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:

×425
×109
×71
×47

question asked: 24 Mar '15, 19:45

question was seen: 4,867 times

last updated: 25 Mar '15, 21:44

powered by OSQA