when user click on the map... get the latitude and longitude of the location and save the values in a database table. whenever map load, you should select marker locations and add them to the map
google maps, is there any possible way to store markers?
-
26-06-2023 - |
Domanda
Hi I have created some simple code where when I click on the map a marker is added but the problem is that if I rerun the application the markers that I added they disappear.Is there any possible way to somehow make them visible even if I rerun the application ? Thanks. Code for markers onmapclick:
gMap.setOnMapClickListener(new GoogleMap.OnMapClickListener(){
@Override
public void onMapClick(LatLng point) {
gMap.addMarker(new MarkerOptions().position(point));
}
});
Soluzione
Altri suggerimenti
Like Dehan Wijesekara said, you can save values in a database but if you want keep it simpler you can use shared preferences.
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow