mapbox / mapbox-plugins-android

Mapbox Android Plugins are a collection of libraries that extend our other SDKs, helping you design powerful mapping features while the plugins handle most of the heavy lifting.
https://www.mapbox.com/android-docs/plugins/overview/
BSD 2-Clause "Simplified" License
241 stars 120 forks source link

InfoWindow and anchor support for MarkerViews. #759

Open DejanRistic opened 5 years ago

DejanRistic commented 5 years ago

I've been playing with the MarkerView plugin so we can experiment with Lottie animations on our markers. While messing with em i've noticed that the plugin is in very early stages and doesn't have much support for anything.

I wasn't able to set an anchor on the view I supplied. So whenever it was added to the map the top left corner of the view was the lat/lng while the rest of the view was laid out below and to the right. I've made my own copies of the 2 classes in the plugin to adjust this.

The view also didn't seem to update its location frequently enough, zooming and panning the map would leave it in the same spot until the map was done rendering. I was able to get around this in my own version of the 2 classes as well.

I wasn't able to find a good way to hook the InfoWindow support the mapbox map has using marker views, is this something that will be added to this plugin? The same question goes for the other things i've had to adjust. Or would it be smarter to try and move to using symbol layers than waiting for this plugin to advance?

tobrun commented 5 years ago

@DejanRistic thank you for reaching out and showing interest in this plugin.

Re. anchor

as part of the update mechanism, we allow you to update the placement and the anchoring through the OnPositionUpdateListener. See code block below:

void update() {
    PointF point = projection.toScreenLocation(latLng);
    if (onPositionUpdateListener != null) {
      point = onPositionUpdateListener.onUpdate(point);
    }
    view.setX(point.x);
    view.setY(point.y);
  }

Re other features

We don't have bandwith or immidate plans to add more features to the plugin atm but we do accept contributions!

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 5 years ago

This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions.

adrianababakanian commented 5 years ago

I am also interested in using lottie-android in conjunction with MarkerViews on a map. I understand that MarkerViews are a less performant way of adding markers to the map than the SymbolLayer alternative, but given that lottie-android seems to rely on an extension of an ImageView, a view seems to be required.

Just wanted to document my interest -- I might jump back in with a contribution if time permits.

stale[bot] commented 4 years ago

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

stale[bot] commented 4 years ago

This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions.

stale[bot] commented 4 years ago

This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions.