Comments (3)
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.
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.
cool. if you're satisfied this'll resolve your issue, feel free to close this thread.
from mapview.
Related Issues (20)
- Centering the map HOT 8
- Project Rename HOT 7
- Does MapView only draw PathViews that are visible? HOT 8
- Polygons as hotspots HOT 6
- Extra zoom feature HOT 8
- Increase the scrollable area in order to scroll the edges of the map into view HOT 4
- How to use HotSpot and HotSpotManager? HOT 3
- Render tiles outside of view HOT 2
- Loading downsample via TileDecoder HOT 2
- Markers moving when zooming HOT 2
- Image moving between zoom levels HOT 6
- Feature Requests HOT 15
- moveTo/slideTo rectangle HOT 4
- slideToAndCenter randomly not works HOT 3
- Adding ZoomLevels dynamically does not allow zooming. HOT 1
- How to listen onLongPress event? HOT 5
- map doesn't redraw after scrolling if scale is greater than 1 HOT 1
- Chaging zoomlevels dynamicaly doesn't show correct tiles HOT 1
- Gradle HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mapview.