Created
December 14, 2015 15:30
-
-
Save leonardreidy/36fc169d9b54c145f016 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if (requestCode == 5 && resultCode == RESULT_OK) { | |
| Toast.makeText(this,"here",Toast.LENGTH_SHORT).show(); | |
| if (data != null) { | |
| Place place = PlacePicker.getPlace(data, this); | |
| if (place != null) { | |
| lat = place.getLatLng().latitude; | |
| lng = place.getLatLng().longitude; | |
| MarkerOptions marker = new MarkerOptions().position( | |
| place.getLatLng()).title("Hello Maps"); marker.icon(BitmapDescriptorFactory | |
| .defaultMarker(BitmapDescriptorFactory.HUE_RED)); | |
| googleMap.addMarker(marker); | |
| } else{ | |
| Toast.makeText(this,"place",Toast.LENGTH_SHORT).show(); | |
| MarkerOptions marker = new MarkerOptions().position( | |
| new LatLng(latitude, longitude)).title("Hello Maps"); | |
| lat = latitude; | |
| lng = longitude; | |
| // Changing marker icon | |
| marker.icon(BitmapDescriptorFactory | |
| .defaultMarker(BitmapDescriptorFactory.HUE_ROSE)); | |
| // adding marker | |
| googleMap.addMarker(marker); | |
| } | |
| } else{ | |
| Toast.makeText(this,"data",Toast.LENGTH_SHORT).show(); | |
| MarkerOptions marker = new MarkerOptions().position( | |
| new LatLng(latitude, longitude)).title("Hello Maps"); | |
| lat = latitude; | |
| lng = longitude; | |
| // Changing marker icon | |
| marker.icon(BitmapDescriptorFactory | |
| .defaultMarker(BitmapDescriptorFactory.HUE_ROSE)); | |
| // adding marker | |
| googleMap.addMarker(marker); | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment