java - Marker To Open Google MAPS Direction -


There are 3 markers in my store location, each with its status (latitude and longitude), I would like to click on the marker So that it opens the standard Google MAPS direction from where the current user is for the destination of the clicked marker, now the user's position is okay, it is okay to click the marker to display snapet, but how do I click on it? Snapat pop out ("Click here for directions") to get Google Maps to come standard for navigating with an Android phone?

  Fixed final lettuce ARCADIA = new letting (-25.746318, 28.221322999999984); Fixed final letting hatfield = new wave long (-25.7487333, 28.23804319999993); Static Last Letting Sentin = New Wave Long (-25.8602778, 28.18944439 99 99957); Private Google Maps map; @ Override protected void saved create (bundled Instansstet) {Suprknkret (saved Instensstet); SetContentView (R.layout.activity_locate_store); LocationManager lm = (LocationManager) getSystemService (context.LOCATION_SERVICE); Lm.requestLocationUpdates (LocationManager.NETWORK_PROVIDER, 0, 0, this); Map = ((MapFragment) getFragmentManager () FindFragmentById (R.id.map)). GetMap (); //map.setMapType(GoogleMap.MAP_TYPE_SATELLITE); Map.setMyLocationEnabled (true); Map.animateCamera (CameraUpdateFactory.zoomTo (5.0f)); Marker aracdia = map.addMarker (New MarkerOptions () status (ARCADIA) .title ("Arcadia") .snippet ("Cnr Beatrix & Hamilton Street \ N Contact:. \ Ntel: 076 7533 123 \ N For Click Guidelines ") .con (bitmap descriptor fractor from Resource (R.drawable.marker_small)); Marker Hatfield = map.addMarker (New MarkerOptions () status (HATFIELD) .title ("Hatfield") icon (BitmapDescriptorFactory.fromResource (R.drawable.marker_small)) ..); Marker Sub :: map.addMarker (New MarkerOptions () status (Centurion) .title ("Centurion") icon (BitmapDescriptorFactory.fromResource (R.drawable.marker_small)) ..);    

You mean you want to click on infowindow and when you call it standard Google Click on the map will launch with the location of the marker as the place

First you need to add a listener to infowindow.

  myMap.setOnInfoWindowClickListener (New OnInfoWindowClickListener) {Public Numerology (Marker Marker) on InfoWindowClick {}});   

Then create an intent with the ground-URI inside infowindowclick:

  myMap.setOnInfoWindowClickListener (New OnInfoWindowClickListener ( } {Public Zero onInfoWindowClick {String uri = String.Format (Locale.ENGLISH, .. "Geo:% f,% f", marker.getPosition () latitude, marker.getPosition () longitude); = New Intent (Intent.ACTION_VIEW, Uri.parse (uri)) Reference. Initial Activity (Intention);}});    

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -