Skip to content
This repository was archived by the owner on Oct 7, 2024. It is now read-only.
This repository was archived by the owner on Oct 7, 2024. It is now read-only.

TilequeryActivity.java cannot resolve methods .tilesetIds in Builder #1402

Open

Description

@inferstudio

I'm trying to integrate the TilequeryActivity.java from the demo into a navigation app - but am having trouble with the .tilesetIds method when building a new class of the MapboxTilequery object.
I get the error " cannot find symbol method .tilesetIds(string)"

Has this method been replaced with something else?

Aside from changing the string of access_token, the code is unchanged from the demo. Here it is:

/**
* Use the Java SDK's MapboxTilequery class to build a API request and use the API response
*
* @PARAM point the center point that the the tilequery will originate from.
*/
private void makeTilequeryApiCall(@nonnull LatLng point) {
MapboxTilequery tilequery = MapboxTilequery.builder()
.accessToken(getString(R.string.mapbox_access_token))
//.tilesetIds("mapbox.bethanyjane.10puvo6w")
.tilesetIDS("mapbox.mapbox-streets-v7")
.query(Point.fromLngLat(point.getLongitude(), point.getLatitude()))
.radius(50)
.limit(10)
.geometry("polygon")
.dedupe(true)
.layers("building")
.build();

    tilequery.enqueueCall(new Callback<FeatureCollection>() {
        @Override
        public void onResponse(Call<FeatureCollection> call, Response<FeatureCollection> response) {
            if (response.body() != null) {
                FeatureCollection responseFeatureCollection = response.body();
                tilequeryResponseTextView.setText(responseFeatureCollection.toJson());
                mapboxMap.getStyle(new Style.OnStyleLoaded() {
                    @Override
                    public void onStyleLoaded(@NonNull Style style) {
                        GeoJsonSource resultSource = style.getSourceAs(RESULT_GEOJSON_SOURCE_ID);
                        if (resultSource != null && responseFeatureCollection.features() != null) {
                            List<Feature> featureList = responseFeatureCollection.features();
                            if (featureList.isEmpty()) {
                                Toast.makeText(TilequeryActivity.this,
                                        getString(R.string.no_tilequery_response_features_toast), Toast.LENGTH_SHORT).show();
                            } else {
                                resultSource.setGeoJson(FeatureCollection.fromFeatures(featureList));
                            }
                        }
                    }
                });
            }
        }

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions