What is the alternative for PathOverlay in MapBox?

  android, geolocation, gps, mapbox, pubnub

I am building a real-time location-sharing Android application using PubNub.
I was following one of their tutorials using Google Maps and they had an extension on using MapBox.
Personally, I was more lenient toward MapBox for their generous free tier.
Saly most of the methods and classes are deprecated by now and I’m not advanced enough to understand MapBox docs.
I have Makers and PathOverLay both not found and the same MapView.
I am using the latest SDK version of Mapbox

    private void initializePolyline() {
        mMapView.removeOverlay(mLine);
        mMapView.clear();
        mLine = new PathOverlay(Color.BLUE, 5);
    }

    private void updatePolyline() {
        mMapView.removeOverlay(mLine);
        mLine.addPoint(mLatLng);
        mMapView.getOverlays().add(mLine);
    }

    private void updateCamera() {
        mMapView.setCameraDistance(10);
        mMapView.setCenter(mLatLng);
    }

    private void updateMarker() {
        if (!isFirstMessage) {
            mMapView.removeMarker(mMarker);
        }
        isFirstMessage = false;
        mMarker = new Marker(mMapView, "", "", mLatLng);
        mMapView.addMarker(mMarker);
    }
}

This is a snippet from MBoxShareLocationActivity.java
Here is the link for the source code provided alongside the tutorial.

Deprecated classes : Markers,PathOverlay not found, GoogleApiClient, LocationServices, FusedLocationApi

Source: Android Questions

LEAVE A COMMENT