maplibre / maplibre-plugins-android Goto Github PK
View Code? Open in Web Editor NEWMapLibre Native for Android Plugins
Home Page: https://maplibre.org/
License: BSD 2-Clause "Simplified" License
MapLibre Native for Android Plugins
Home Page: https://maplibre.org/
License: BSD 2-Clause "Simplified" License
I had been discussing with @louwers also re. maplibre/maplibre-native#1151 (comment) how to structure the Android-specific code.
I notice that there is currently some deprecated annotations code in maplibre native, and a non-deprecated (but highly confusingly essentially duplicate) implementation here in the plugins. Most of the maplibre plugins are currently also unmaintained.
It can also be confusing for developers that there's two separate sample apps (one for maplibre-plugins-android and one for maplibre-native android).
For these reasons we think that the current situation is rather messy and should be cleaned up. One possibility would be to move the plugins into maplibre-native.
Possible benefits (if done correctly):
CONTRIBUTING.md
, remove things that are not relevant anymore going forward.README.md
and add a warning that each plugin (except Annotations) that it is unmaintained.After this is done we can make a release.
Hello I noticed a bug, I think I can find the cause but is the repo open to PR?
A lot of things including Gradle (the wrapper), Android Gradle Plugin and Kotlin Gradle Plugin are three years out of days. I am having a lot of build problems because of that. kotlin-android-extensions
is also deprecated: https://developer.android.com/topic/libraries/view-binding/migration
We should have a CI that ensures that contributions do not add files that are formatted badly by mistake.
Background: in #21 (review), the indentation of a lot of files were changed by accident. If I see correctly (I might not), the repo had also been previously formatted inconsistently between 2-spaces and 4-spaces indentation.
cc @louwers
I think we should remove the fork information and make this repo a new base repo.
@nyurik do I have to contact GitHub support for this or should I delete and recreate this repo?
note to self: look at #2 and #5 (comment) after this is processed
"Packages No packages published" is displayed right now, fortunately this pointless section can be removed.
Edit repo page config to remove it (cog next to the description).
I am not making a PR as it is defined in proprietary github settings, not in a git repository - and I have no rights to modify repo settings.
Maybe also releases should be removed
Is it working after the fork? Is data provided OK with use of this data or is it relying on something Mapbox specific?
https://github.com/mapbox/mapbox-plugins-android/tree/master/plugin-traffic
Would it be possible to have Android Auto support? Are there any difficulties/blockers?
The marker view plugin has multiple issues at this moment that make it infeasible to be used in some cases.
View
. Sometimes you need many markers and only show details on click, which would right now require, as far as I can tell, removing the "normal", performant marker (rendered with native code) and replacing it with a MarkerView
.Additional info: I have written code for microG's maps that implement Google Maps info windows. Maybe this can be useful somewhere, just wanted to mention it here. MapLibre-native itself also has such an imementation for its own marker annotation implementation.
cc @louwers
version:
Only chinese works, any other characters will not work. Why? Is my usage wrong?
Works:
Symbol symbol = symbolManager.create(
new SymbolOptions()
.withLatLng(
new LatLng(28.693, 101.30934)
)
.withTextField("中文")
);
symbolManager.update(symbol);
Not works:
Symbol symbol = symbolManager.create(
new SymbolOptions()
.withLatLng(
new LatLng(28.693, 101.30934)
)
.withTextField("中文hi") // hi, 中文123, 中-文 not work
);
symbolManager.update(symbol);
If any withTextField contains non-chinese , all Symbol can not show.
MapLibre Native Android 11.0.0 has different import paths. Does anyone volunteer to update this package?
MapLibre itself now has minSdkVersion 21
, while the plugins still declare minSdkVersion 14
:
Which is cool by itself but doesn't really make sense for the future, so we should align the value there :)
Right now this is not the case:
https://github.com/maplibre/maplibre-plugins-android/blob/main/.github/workflows/ci.yml#L4
Can I use Maplibre plugins without Mapbox credentials?
I want to use basic marker, scale map features. Is there a way to use without mapbox?
After merging #12, the tests fail: https://github.com/maplibre/maplibre-plugins-android/actions/runs/4255578822/jobs/7403370903
com.mapbox.mapboxsdk.plugins.annotation.FillManagerTest > testInitialization FAILED
Wanted but not invoked:
geoJsonSource.setGeoJson(
<any com.mapbox.geojson.FeatureCollection>
);
-> at com.mapbox.mapboxsdk.style.sources.GeoJsonSource.setGeoJson(GeoJsonSource.java:291)
Actually, there were zero interactions with this mock.
at com.mapbox.mapboxsdk.style.sources.GeoJsonSource.setGeoJson(GeoJsonSource.java:291)
at com.mapbox.mapboxsdk.plugins.annotation.FillManagerTest.testInitialization(FillManagerTest.java:68)
We should set up CI for pull requests so that we avoid this in the future.
After a line pattern is set, it cannot be un-set anymore to get back the default stroke (i.e. a colorful line).
I made a demo inside the sample app in https://github.com/e-foundation/maplibre-plugins-android/tree/demo-line-pattern (based on https://github.com/louwers/maplibre-plugins-android/tree/update-repo). To reproduce:
setLinePattern(null)
was called).(There's also some unrelated crashes in there.)
I thought that this diff would fix it, but it doesn't have any effect:
diff --git a/plugin-annotation/src/main/java/com/mapbox/mapboxsdk/plugins/annotation/Line.java b/plugin-annotation/src/main/java/com/mapbox/mapboxsdk/plugins/annotation/Line.java
index c4cac02..3f47e5a 100644
--- a/plugin-annotation/src/main/java/com/mapbox/mapboxsdk/plugins/annotation/Line.java
+++ b/plugin-annotation/src/main/java/com/mapbox/mapboxsdk/plugins/annotation/Line.java
@@ -343,7 +343,11 @@ public class Line extends Annotation<LineString> {
* @param value constant property value for String
*/
public void setLinePattern(String value) {
- jsonObject.addProperty(LineOptions.PROPERTY_LINE_PATTERN, value);
+ if (value != null) {
+ jsonObject.addProperty(LineOptions.PROPERTY_LINE_PATTERN, value);
+ } else {
+ jsonObject.remove(LineOptions.PROPERTY_LINE_PATTERN);
+ }
}
@Override
If I create two circles in two different managers, the second one appear above the first one, but the first one gets priority when dragging.
I can solve that by setting the belowLayer
of the second manager to the layerId
or the first manager. So the drawing order seems fine, but the dragging order is wrong (it should follow the drawing order).
Here is the code I am testing:
val circleAnnotationManager = CircleManager(map, mapboxMap, style)
val circleOptions = CircleOptions()
.withCircleColor("Blue")
.withCircleRadius(30.0F)
.withLatLng(LatLng(46.0, 6.0))
.withDraggable(true)
circleAnnotationManager.create(circleOptions)
val circleAnnotationManager2 = CircleManager(map, mapboxMap, style)
val circleOptions2 = CircleOptions()
.withCircleColor("Yellow")
.withCircleRadius(30.0F)
.withLatLng(LatLng(46.0, 6.0))
.withDraggable(true)
circleAnnotationManager2.create(circleOptions2)
And here is a video showing the result:
@louwers @fynngodau: any idea where this could be happening? If you point me roughly where you think it could be in the code, I'm happy to try to debug it 😊.
@petr-pokorny-1, this repo seems to be inactive. Can we archive it?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.