-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #250 from onaio/40-make-location-blue-circle-radiu…
…s-configurable Make location blue circle radius configurable
- Loading branch information
Showing
21 changed files
with
433 additions
and
123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
library/src/main/java/io/ona/kujaku/callbacks/OnLocationServicesEnabledCallBack.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package io.ona.kujaku.callbacks; | ||
|
||
/** | ||
* @author Vincent Karuri | ||
*/ | ||
public interface OnLocationServicesEnabledCallBack { | ||
void onSuccess(); | ||
} |
31 changes: 31 additions & 0 deletions
31
library/src/main/java/io/ona/kujaku/helpers/MapboxLocationComponentWrapper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package io.ona.kujaku.helpers; | ||
|
||
import android.content.Context; | ||
import android.support.annotation.NonNull; | ||
|
||
import com.mapbox.android.core.location.LocationEngine; | ||
import com.mapbox.mapboxsdk.location.LocationComponent; | ||
import com.mapbox.mapboxsdk.location.modes.CameraMode; | ||
import com.mapbox.mapboxsdk.location.modes.RenderMode; | ||
import com.mapbox.mapboxsdk.maps.MapboxMap; | ||
|
||
/** | ||
* @author Vincent Karuri | ||
*/ | ||
public class MapboxLocationComponentWrapper { | ||
|
||
private LocationComponent locationComponent; | ||
|
||
@SuppressWarnings( {"MissingPermission"}) | ||
public void init(@NonNull MapboxMap mapboxMap, @NonNull Context context) { | ||
locationComponent = mapboxMap.getLocationComponent(); | ||
locationComponent.activateLocationComponent(context, (LocationEngine) null); | ||
locationComponent.setLocationComponentEnabled(true); | ||
locationComponent.setCameraMode(CameraMode.NONE); | ||
locationComponent.setRenderMode(RenderMode.NORMAL); | ||
} | ||
|
||
public LocationComponent getLocationComponent() { | ||
return locationComponent; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.