You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Enable Customisation for Location Layer Plugin #183
@RequiresPermission(anyOf = {Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION})
public void setLocationLayerEnabled(@LocationLayerMode.Mode int locationLayerMode) {
if (locationLayerMode != LocationLayerMode.NONE) {
locationLayer.setLayerVisibility(true);
// Set an initial location if one is available and the locationEngines not null
if (locationEngine != null) {
setLastLocation();
locationEngine.addLocationEngineListener(this);
}
if (locationLayerMode == LocationLayerMode.COMPASS) {
setLinearAnimation(false);
setNavigationEnabled(false);
setMyBearingEnabled(true);
} else if (locationLayerMode == LocationLayerMode.NAVIGATION) {
setMyBearingEnabled(false);
setNavigationEnabled(true);
} else if (locationLayerMode == LocationLayerMode.TRACKING) {
setLinearAnimation(false);
setMyBearingEnabled(false);
setNavigationEnabled(false);
}
} else {
// Check that the mode isn't already none
if (this.locationLayerMode != LocationLayerMode.NONE) {
disableLocationLayerPlugin();
}
}
this.locationLayerMode = locationLayerMode;
}
Please enable any customisation on these methods since you depricated everything should be the time to update everything.... There is currently no good way to update user location icon.
Solution: some methods that we can do that and enable the structure of the code
Solution2: Requested seems like there is something wrong with that plugin and there is no location tracking what so ever. On never devices and old one is depricated
You can apply new styles to your location layer icons using a custom style and using the LocationLayerPlugin.applyStyle. The custom style would look like so:
Does this fit your needs or is there something missing. Note, this method didn't work properly in 0.2.0 but has been fixed since and will be in the 0.3.0 release.
@cammace I'm not sure it addresses everything, like allowing a custom image loaded after the app starts to be used as the user location annotation. The style approach assumes the image you want is already in your project and can be used through a style.
I think its important because the now deprecated MyLocationViewSettings supported this, doesn't make sense to deprecate something and replace it with something new if it doesn't at least support what you had before for applications that were relying on it. A little weird it was marked deprecated before its replacement is at least at a stable 1.0.
@cammace Thanks for all the hard work on this so far.
I'm still not seeing a way for me to set the background/foreground drawables directly using bitmaps loaded at runtime. The location layer options just let you set int values that have to be pulled from existing resources in the project.
I do see the layer itself does create a drawable, transforms it into a bitmap, and then adds the bitmap directly to the layer. Can we expose this on the location layer plugin or the options? Just so we can use a bitmap loaded from our server vs needing to rely on resources in our drawable folders.
A simple addition to allow something like this would be helpful and I wouldn't have to clone the entire plugin just to expose setting bitmaps directly:
return LocationLayerOptions.builder(context)
.backgroundImage(myBackgroundBitmap) // Why not support drawable, bitmap, or res.
.foregroundImage(myForegroundBitmap) // Why not support drawable, bitmap, or res.
.build();
I like this idea. I've opened #486 to track progress on this. What I'm thinking is to have an overloaded method that also allows passing in a String (the bitmap id) and if that's used, just go ahead and use those images. Thanks for the feedback :)
Activity
cammace commentedon Dec 22, 2017
You can apply new styles to your location layer icons using a custom style and using the
LocationLayerPlugin.applyStyle. The custom style would look like so:Does this fit your needs or is there something missing. Note, this method didn't work properly in
0.2.0but has been fixed since and will be in the 0.3.0 release.DejanRistic commentedon Jan 10, 2018
@cammace I'm not sure it addresses everything, like allowing a custom image loaded after the app starts to be used as the user location annotation. The style approach assumes the image you want is already in your project and can be used through a style.
I mention this in the issue that was closed:
#178
I think its important because the now deprecated MyLocationViewSettings supported this, doesn't make sense to deprecate something and replace it with something new if it doesn't at least support what you had before for applications that were relying on it. A little weird it was marked deprecated before its replacement is at least at a stable 1.0.
cammace commentedon Feb 14, 2018
#267 added all the location layer options previously available inside the MyLocationViewSettings class and more.
DejanRistic commentedon May 7, 2018
@cammace Thanks for all the hard work on this so far.
I'm still not seeing a way for me to set the background/foreground drawables directly using bitmaps loaded at runtime. The location layer options just let you set int values that have to be pulled from existing resources in the project.
I do see the layer itself does create a drawable, transforms it into a bitmap, and then adds the bitmap directly to the layer. Can we expose this on the location layer plugin or the options? Just so we can use a bitmap loaded from our server vs needing to rely on resources in our drawable folders.
A simple addition to allow something like this would be helpful and I wouldn't have to clone the entire plugin just to expose setting bitmaps directly:
Thanks!
cammace commentedon May 7, 2018
I like this idea. I've opened #486 to track progress on this. What I'm thinking is to have an overloaded method that also allows passing in a String (the bitmap id) and if that's used, just go ahead and use those images. Thanks for the feedback :)
DejanRistic commentedon May 7, 2018
🙇 🙇