Git Product home page Git Product logo

Comments (3)

moagrius avatar moagrius commented on August 22, 2024

I've had this happen before as well (with both markers and callouts) - in my specific use-case, I just specified a positive anchor point for markers and callouts that would be positioned off screen (and a different image as well, one that pointed up, for example, instead of down, to indicate the actual "point" the marker was indicating).

So while an anchor of -0.5f, -1.0f positions the marker centered above the actual point, you could use -0.5f, 1.0f (notice the lack of the negative sign on the y-axis anchor) to position is centered below the point (this would be appropriate for where a marker was offscreen by being to close to the top border).

Remember that you can specify anchors for individual markers and callouts (like addMarker(View, double, double, float, float) and addCallout(View, double, double, float, float)), that will override the default set by setMarkerAnchorPoints(float, float)

In my case, I had a small number of markers and just hard-coded the ones that would be offscreen with the appropriate anchors, but I can imagine a lot of circumstances where it'd need to be dynamically calculated. There's nothing built-in to handle that directly, but i'd imagine it wouldn't be too tough to implement.

HTH, LMK either way.

from mapview.

phil-applegate avatar phil-applegate commented on August 22, 2024

Thanks, this all makes sense - I'll look into changing anchor points of the markers, seems more sensible than adding unnecessary whitespace!

Thanks for your help.

from mapview.

moagrius avatar moagrius commented on August 22, 2024

cool. if you're satisfied this'll resolve your issue, feel free to close this thread.

from mapview.

Related Issues (20)

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.