I'm trying to deactivate previous tiles when zooming in/out.
Currently the map loads all of the tiles and keeps the old ones there (scaled up) until the whole loading is completed, I could not find any setting to modify this case;
So I'm wondering how can I do this. Thanks!
What happens if you set zoomAnimation to be false on your Map object? I've never used this setting myself, but I've always assumed it would turn off the behaviour you don't want.
Related
I am developing a weather radar viewer using Mapbox. In a certain mode, there are 2 Mapbox maps on the screen at the same time showing different modes of the radar. The maps are locked to each other. When one map moves, rotates, or pans - the other one does as well. I did this by simply passing the properties of one map to the other. In the below screenshot, you will see how they are showing identical locations.
What I want to do is - when the user is hovering the mouse over "map1", I would like an identical (ghost or false) cursor on "map2". Here is what I am looking to do:
(edit: What you are looking at is an actual screenshot. Each map is enclosed in a DIV with 50% width of the screen, if this helps to explain)
I don't know if this is even possible in Mapbox. Hopefully someone can give some guidance as I can't find any other questions related to this and I really have no code to show without knowing where to start.
If you attempt to do this inside Mapbox-GL-JS (for instance, by constantly updating the location of a GeoJSON feature layer), I think the performance will be pretty poor.
But since the two views are exactly locked (and presumably the exact same dimensions), you can just do this at an HTML/CSS level. Detect mouse movement on the first map, and update the location of an absolutely-positioned element hovering over the second map to match.
Another approach would be using a canvas element overlaid over the second map, similarly updated.
For an Android App I have created a custom overlay here, to display various items of game data on the map.
In general the overlay works fine and smoothly!
However there is one geometrical constellation which is not working as expected: Some objects within the overlay are not bound to geocoordinates, but to current user location. Now it happens, that Osmdroid is selectively redrawing the screen. When the screen is not focussed to user location, the user location bound stuff is not updated correctly: New stuff gets only drawn in some selective rectangle, old stuff isn't deleted outside that rectangle.
So far I failed to find a mechanism to communicate the required redraw of an overlay to the basic Osmdroid system? I.e. to invalidate the surroundings of the current user location? Any hint, clue or pointer?
By studying the sample code I realized they really consider it the overlay responsibility to issue appropriate invalidate calls to the map component to ensure their own optical integrity.
I am still struggling with the coordinates to do the right invalidate(left, top, right, buttom) calls cause my updates actually happen on location changes and it is unclear to me if the screen pixel of the map to be invalidated need to get measured relative to the old location or the new one. This is actually a timing question.
However taking the CPU byte and issuing postInvalidate() just looks as intended and it is unclear how much performance is really lost.
I spent many hours on it but not getting any fruitful response.I am trying to increasing the size of overlay icon when map is zoom but its not work, I am new on this please help on this
Yes it is, however you have to do the work. Basically, you need to create an MapView.onChangeListener and register it. When the zoom level changes, you need to iterate though your overlays and replace the icon with one of a different size.
At some point in your travels, you'll probably figure out that there will be concurrency/inconsistency issues with over zealous zoomers and panners. To handle this, you can wait until after the user stops scrolling or zooming after a period of time, then do the work.
I am creating a map application, in which I am showing MKPolylineView(around 2000) and MKAnnotations with pin drop.
I want to make visible either set of MKPolylineViews or MKannotations at a time. I am managing it with 2 buttons, one button is to display set of MKPolylineViews and another for set of MKAnnotations. So I tried 2 methods to manage this scenario, which is following:
For MKAnnotations, I am removing it and adding it again.
In the case of MKPolylineViews, I tried 2 ways:
I tried to make all MKPolylineViews hidden to YES and NO to manage it visibility based on button click. In this case, when I make the MKPolylineViews visible from it's hidden state, not all the MKPolylineView are visible. I tried with alpha and hidden property. In both the cases, the result was same, not all the lines are visible. Is there any mechanism to make all the lines visible. Because the performance is good in this case.
Then I tried another way, in which I removed all the MKPolylineOverlays and add it again. This case, everything works well. But the main thread freeze the UI for some seconds. Remember I am adding around 2000 MKPolyLineView. How can I manage it.
Instead of removing the overlay, when I used the hidden and alpha property, the performance was good. But half of the lines are not visible, when I make it visible from it's hidden state. Around half of the overlays couldn't be visible.
Another help that I need is since I am using around 2000 MKOverlays, the app got free for a few seconds while zooming. I think in this case, the map is re rendering the overlay at each zoom level. Is there any way to handle it efficiently?
Can anyone help me the best way to handle this scenario.
Thanks and regards,
Sreelash
Am working on a project where we have a Bing map being resized depending on whether or not a panel is shown/hidden on the left-hand side of the map. Because of this, and Microsoft's terms preventing overlaying anything over the logo/copyright, etc, I'm using the VEMap.resize method to resize the map, and then am moving the panel out of the way. The issue is that there's an awkward autopan that occurs as part of the resize - because we're declaring a center point to determine the resize, the map pans to include this point in the center without any control over it. Without declaring a center, the map doesn't pan, but it also doesn't pull the new data (map tiles) in our resize in either, resulting in an awkward grey bar on the right-hand side..
Is there a simple way to either resize the map and disable that autopan, moving the center prior to the panning, or to force the map tiles to be rendered upon the resize itself? Any help would be appreciated.
You may want to try the new version 7.0 as you could get rid of this annoyance by using "map.setView({center: map.getCenter(), animate:false})" after resizing; that should override the nice but annoying pan movement on resize.
However there are a few features (like infoboxes or client-side clustering) currently missing in 7.0 when migrating from 6.3 however and the classnames changed, so you may want to wait for now, however it would be the good moment to prepare yourself for 7.