I'm showing a geojson file as a layer over a google map android app. Everything works ok, but I'm not be able to trigger on click in geojson markers.
I have adapted the code in: https://github.com/googlemaps/android-maps-utils/blob/master/demo/src/com/google/maps/android/utils/demo/GeoJsonDemoActivity.java
but in line 142:
layer.setOnFeatureClickListener(new GeoJsonLayer.GeoJsonOnFeatureClickListener() {
I get:
cannot resolve method 'setOnFeatureClickListener()'
This is my code in onPostExecute;
@Override protected void onPostExecute(JSONObject jsonObject) { if (jsonObject != null) { // Create a new GeoJsonLayer, pass in downloaded GeoJSON file as JSONObject mLayer = new GeoJsonLayer(map, jsonObject); // Add the layer onto the map addColorsToMarkers(); mLayer.addLayerToMap(); mLayer.setOnFeatureClickListener(new GeoJsonLayer.GeoJsonOnFeatureClickListener() { @Override public void onFeatureClick(GeoJsonFeature feature) { } }); } }
Do I need to add something else?
Any suggestions? Thanks