0

Hi ,

I am working on a project to implement maps in android. I have used OSMDroid and successfully displayed it.

I want to add markers on my map so I can form a path. Now I can add markers if I enter the GPS coordinates manually. But I want to add the markers automatically if i click on the map.

Is there any way to get this data? Please help.

PS : This is an offline map. I checked by giving GPS coordinates and having data off, the marker was added. So , I know that it can be done but I dont know how.

asked 21 Jul '14, 07:12

anshumank's gravatar image

anshumank
11223
accept rate: 0%

edited 09 Apr '15, 12:44

aseerel4c26's gravatar image

aseerel4c26 ♦
32.2k16239552


2 Answers:
1

Have a look at MapEventsReceiver from the osmbonuspack and this groups thread.

permanent link

answered 09 Apr '15, 10:37

bmla's gravatar image

bmla
16
accept rate: 0%

edited 09 Apr '15, 12:44

aseerel4c26's gravatar image

aseerel4c26 ♦
32.2k16239552

yes, "single tap" and "long press" sounds like what the question is, in my opinion. I have replaced your URL with the new one (according to the project's home page) since google code will vanish next year.

(09 Apr '15, 12:43) aseerel4c26 ♦
0

Osmdroid is some software that happens to use OSM data, rather than "part of OSM". There's a Google Group for it; people there will be more familiar with it than here.

However, it sounds like you're just asking "how do I get the current location on Android"? That stackoverflow questions links to examples and covers the issues, including whether you want to use Google Play Services or not.

permanent link

answered 21 Jul '14, 09:35

SomeoneElse's gravatar image

SomeoneElse ♦
33.0k65343778
accept rate: 16%

edited 21 Jul '14, 09:37

"I want to add the markers automatically if i click on the map" does not sound like getting the current (gps) location is the question (I have removed the "gps" tag therefore). "GPS coordinates" should likely just mean "coordinates".

(09 Apr '15, 12:37) aseerel4c26 ♦

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:

×110
×79
×44
×6

question asked: 21 Jul '14, 07:12

question was seen: 7,105 times

last updated: 09 Apr '15, 12:45

powered by OSQA