Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add marker api #28

Closed
seddonm1 opened this issue Apr 30, 2018 · 7 comments
Closed

Add marker api #28

seddonm1 opened this issue Apr 30, 2018 · 7 comments

Comments

@seddonm1
Copy link
Contributor

@tobrun I have tried to add the addMarker capability (without custom icon to start) but seeing an Java exception:

E/MethodChannel#com.mapbox/flutter_mapbox(14564): Failed to handle method call
E/MethodChannel#com.mapbox/flutter_mapbox(14564): java.lang.NullPointerException
E/MethodChannel#com.mapbox/flutter_mapbox(14564): 	at com.mapbox.mapboxsdk.maps.NativeMapView.nativeAddMarkers(Native Method)
E/MethodChannel#com.mapbox/flutter_mapbox(14564): 	at com.mapbox.mapboxsdk.maps.NativeMapView.addMarker(NativeMapView.java:406)

This looks like an upstream problem as the Marker object is correct. can you have a look? https://github.com/seddonm1/flutter-mapbox-gl/tree/add-marker

@tobrun tobrun added this to the future milestone May 2, 2018
@tobrun tobrun added the flutter label May 2, 2018
@tobrun
Copy link
Member

tobrun commented May 2, 2018

Could be related to the icon image? Haven't had time to look into this, just wanted to flag that we are going to rework the annotations API upstream, so might be better holding of development of this feature until that lands. If you feel this can't wait, feel free to move forward.

@tobrun tobrun added the feature label May 2, 2018
@tobrun
Copy link
Member

tobrun commented Jul 26, 2018

upstream seems to not be happening in the near future, so maybe we should move forward with the annotations approach

@Timouri
Copy link

Timouri commented Jul 31, 2018

Hm.. You can use this code in FlutterMap.java:

public void addMarker(Marker marker) {
    MarkerOptions options = new MarkerOptions()
        .icon(IconFactory.getInstance(context).defaultMarker())
        .position(marker.getPosition())
        .snippet(marker.getSnippet())
        .title(marker.getTitle());
    nativeMapView.addMarker(new Marker(options));

Now, i not founded any exception, but marker does not appear.
Maybe IconFactory.getInstance(context).defaultMarker() - returned empty icon?

-- Adding
With downloading bitmap from url -
IconFactory.getInstance(context).fromBitmap(uriBitmap) - error was repeated.

@kaiquegazola
Copy link

@tobrun any updates?

@tobrun
Copy link
Member

tobrun commented Sep 24, 2018

@kaiquegazola we are working on improving annotations api in https://github.com/mapbox/mapbox-plugins-android/tree/master/plugin-annotation. Once finalised, we will work on integrating this inside this project.

@Ivaskuu
Copy link

Ivaskuu commented Nov 18, 2018

@tobrun Any updates on this? This is the perfect plugin for me, except that it lacks the ability to add markers. It would be cool if we could also specify a custom Flutter widget for the marker icon (like in the other mapbox plugin except with raster tiles)!

@tobrun
Copy link
Member

tobrun commented Feb 2, 2019

This project will be moved to https://github.com/tobrun/flutter-mapbox-gl
Marker API through the annotation plugin is one of the most important features to support.
This feature request was added to flutter-mapbox-gl/maps#4 (comment)

@tobrun tobrun closed this as completed Feb 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants