简体   繁体   中英

Get Primary Key of Marker Clicked in Google Map in Android Development

Help Needed. I have stored marker locations in an sqlite database in an android application in this way

  1. Primary Key
  2. Latitude
  3. Longitude
  4. Zoom

I want to compare all stored locations with my current location at regular intervals and want to delete any marked location whenever I want to remove and want to get primary key of clicked marker. Can anyone help me how to perform these operations by providing source code for this problem?

you can get you primary key by this query

var latitude,longitude; String query = "SELECT PrimaryKey FROM YourTable WHERE Latitude='"+latitude+"' AND Longitude='"+longitude+"';

then you can use this one to delete your pin from the map,

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM