Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Remove requirement for an Adapter on MarkerView #5214

Closed

Description

@tobrun

Currently we require a developer to provide an MarkerViewAdapter to be able show a MarkerView.
Current game plan is to remove this requirement and handle the logic for them. Internally the base MarkerView will be backed up by ImageMarkerViewAdapter and will leverage the Icon attribute in Marker.

Activity

  1. added
    Android
    annotations
    on Jun 2, 2016
  2. added this to the android-v4.1.0 milestone on Jun 2, 2016
  3. Schumi09 commented on Jun 2, 2016

    @Schumi09

    Sounds amazing, this will make it much more handy! I couldn't even convert the icon's bitmap of the passed marker back to a drawable and use it for viewHolder.icon.setImageDrawable()
    Guess I don't have to write my own View classes anymore just to pass a drawable directly.

  4. tobrun commented on Jun 2, 2016

    @tobrun
    MemberAuthor

    @Schumi09

    I couldn't even convert the icon's bitmap of the passed marker back to a drawable and use it for viewHolder.icon.setImageDrawable())

    With the changes made you can achieve that as well ;)

  5. tobrun commented on Jun 2, 2016

    @tobrun
    MemberAuthor

    This is the code a developer needs to write to show a normal MarkerView:

       MarkerViewOptions options = new MarkerViewOptions();
                    options.title("United States");
                    options.icon(IconFactory.getInstance(mMapView.getContext())
                            .fromResource(R.drawable.ic_us));
                    options.position(new LatLng(38.899774, -77.023237));
                    options.flat(true);
        markerView = mapboxMap.addMarker(options);

    Below you can see where I'm updating the Icon every 3 seconds through markerView.setIcon():

    ezgif com-video-to-gif

  6. Schumi09 commented on Jun 2, 2016

    @Schumi09

    Good job 👍

    Will it make it into the tomorrow's snapshot?

    Maybe you could also test the behaviour of the issues I have experienced concerning the removing and adding new markerviews (#5161). Moreover, you said that the View things will provide a fix to disappearing Icons/Markers during runtime. Did it fix it?

  7. tobrun commented on Jun 2, 2016

    @tobrun
    MemberAuthor

    Maybe you could also test the behaviour of the issues I have experienced concerning the removing and adding new markerviews (#5161).

    I'm planning to do some general improvement to this system in #5076, this includes looking into above.

    you said that the View things will provide a fix to disappearing Icons/Markers during runtime. Did it fix it?

    Yes this issue should be resolved by using this API.

  8. added 3 commits that reference this issue on Jun 2, 2016
  9. tobrun commented on Jun 3, 2016

    @tobrun
    MemberAuthor

    merged with 087cad0, closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Androidannotations

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions