Appolica / InteractiveInfoWindowAndroid

Library project, developed and maintained by Appolica, offering an interactive info window for Google maps on Android.
249 stars 56 forks source link

handle GoogleMap clicks #25

Closed MahmoudiOussama closed 5 years ago

MahmoudiOussama commented 7 years ago

Hi all, i started using this library 2 days ago, i would say "Bravo" for your hard work guys.

I just wanted to set a listener on the GoogleMap object, so i could hide my app's action bar for example, but it won't work for me. So any idea what's the problem guys ?

this is what i am doing in code : mMapFragment = (MapInfoWindowFragment) getChildFragmentManager().findFragmentById(R.id.mapView); infoWindowManager = mMapFragment.infoWindowManager(); infoWindowManager.setHideOnFling(true); mMapFragment.getMapAsync(this);

@Override public void onMapReady(GoogleMap Map) { googleMap = Map; setUpMap(); try { // Customise the styling of the base map // using a JSON object defined in a raw resource file. googleMap.setMapStyle(MapStyleOptions.loadRawResourceStyle(getContext(), R.raw.map_day_style)); } catch (Exception e) { }

    //Creating InfoWindow marker specifications
    offsetX = (int) getActivity().getResources().getDimension(R.dimen.marker_offset_x);
    offsetY = (int) getActivity().getResources().getDimension(R.dimen.marker_offset_y);
    markerSpec = new InfoWindow.MarkerSpecification(offsetX, offsetY);

    googleMap.setOnMarkerClickListener(MapFragment.this);
    googleMap.setOnMapClickListener(new GoogleMap.OnMapClickListener() {
        @Override
        public void onMapClick(LatLng latLng) {
            Log.d("TEST"," onMapClick ");
        }
    });

}

deangenovski commented 5 years ago

duplicate of https://github.com/Appolica/InteractiveInfoWindowAndroid/issues/40