Giter VIP home page Giter VIP logo

maplibre-plugins-android's Introduction

MapLibre Organization

https://www.maplibre.org/

This repository contains various documents that define the MapLibre Organization such as the Charter, our Code of Conduct, the list of Voting Members, and more.

You also find here the results of past Governing Board elections.

Formatting

Markdown files in this repo are formatted with markdownlint. If you have formatting problems you can sometimes fix them with:

npx markdownlint-cli *.md --fix

maplibre-plugins-android's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

maplibre-plugins-android's Issues

annotation-v9:2.0.1:SymbolOptions().withTextField("中文") only works with chinese?!

version:

  • org.maplibre.gl:android-sdk:10.2.0
  • org.maplibre.gl:android-plugin-annotation-v9:2.0.1

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.

Annotation dragging does not respect the layer order

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:

maplibre-wrong-drag-order.mp4

@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 😊.

Line pattern cannot be un-set

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:

  1. Compile
  2. Open Change Line demo
  3. In the overflow menu, select Toggle Pattern. Now a pattern is shown on the line.
  4. Select Toggle Pattern again. The pattern is not shown anymore, but at the same time, the entire line becomes invisible (even though you'd expect it to be back to its previous state, since 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

MarkerView Plugin

The marker view plugin has multiple issues at this moment that make it infeasible to be used in some cases.

  • Right now, each and every marker added through it is a 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.
  • All the markers being views also results in some latency relative to the map moving. So far I haven't been able to figure out how to position views on top of the map exactly in sync with the map. It feels like it should be possible – maybe it is easier to achieve if this feature is moved to maplibre-native and there's some code to support synced rendering there.

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

Future of plugins repository

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):

  • remove deprecated code and replace it with working one
  • less confusing structure
  • tighter integration has benefits regarding APIs for users (more sensical structure)

Remove fork

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?

Consider editing repository setings to remove "Packages" section

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

Peek 2020-10-25 09-10

Android Auto

Would it be possible to have Android Auto support? Are there any difficulties/blockers?

Formatter CI

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

Tests fail: Wanted but not invoked: geoJsonSource.setGeoJson

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.

Remove references to Mapbox

  • Remove or replace all references to Mapbox in the documentation of the repository (including the logo).
  • Rename all plugins to use a maplibre resource identifier.
  • Update CONTRIBUTING.md, remove things that are not relevant anymore going forward.
  • Add a call to maintainers to the README.md and add a warning that each plugin (except Annotations) that it is unmaintained.

After this is done we can make a release.

Maplibre plugins without Mapbox?

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.