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.

Add anchor to MarkerView #5079

Closed
Closed

Description

@tobrun

Google exposes customization of Anchor:

The point on the image that will be placed at the LatLng position of the marker. This defaults to the middle of the bottom of the image.

Now that #3276 landed we can implement this in MarkerView/MarkerViewOptions (vs GL Marker #2916).

Activity

  1. added
    Android
    annotations
    on May 20, 2016
  2. added this to the android-v4.1.0 milestone on May 20, 2016
  3. tobrun commented on May 24, 2016

    @tobrun
    MemberAuthor

    Note that Google maps also exposes this for InfoWindow

  4. tobrun commented on May 24, 2016

    @tobrun
    MemberAuthor

    At this point we are exposing:

    PointF centerOffset;
    Point infoWindowOffset;

    This should be replaced with Anchor API instead:

    float anchorU;
    float anchorV;
    float infoWindowAnchorU;
    float infoWindowAnchorV;
    

    This is how Google exposes this in their javadoc:

    screen shot 2016-05-24 at 14 58 52

  5. tobrun commented on May 24, 2016

    @tobrun
    MemberAuthor

    This is how the default implementation works:
    device-2016-05-24-160242

    Note that the default values for u = 0.5 and v = 1.0 are used.
    This results in anchoring the annotation to the bottom center.

  6. tobrun commented on May 24, 2016

    @tobrun
    MemberAuthor

    This is the result for u = 0 and v = 0 aka topleft:

    screen shot 2016-05-24 at 16 09 21

    This is the result for u = 1 and v = 1 aka bottomright:

    screen shot 2016-05-24 at 16 11 32

    This is the result for u = 0.5 and v = 0.5 aka center:

    screen shot 2016-05-24 at 16 13 05

    This is the result for u = 0 and v = 0.5:

    screen shot 2016-05-24 at 16 06 46

  7. tobrun commented on May 24, 2016

    @tobrun
    MemberAuthor

    It seems that InfoWindow anchoring needs some extra work. Our current setup doesn't match how Google maps was setup. This will require some extra code to not break current exposed logic for GL based annotations.

  8. tobrun commented on May 25, 2016

    @tobrun
    MemberAuthor

    I was able to get the old InfoWindow logic working with the newer anchoring. This is currently introducing some unneeded overhead but this can only be resolved if we implement anchoring of GL based markers (else we would have a breaking API change for users using the GL based annotations).

    Here you see a screenshot with anchoring in action:

    • bottom left has infoWindowAnchor(1.0f, 1.0f)
    • center has infoWindowAnchor(0.5f, 0.0f) (default value)
    • right has infowWindowAnchor(0.0f, 0.0f)

    device-2016-05-25-103200

  9. self-assigned this
    on May 25, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Androidannotationsfeature

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions