Leaflet map scrolls uncontrollably - leaflet

I'm fairly new to Leaflet, but a veteran web map programmer.
I'm just now building a map utility for an embedded system (Qlikview), and it seems to work nicely enough.
But there's one fairly serious issue, which I can't get a handle on.
The map utilizes an open map tile service as background basemap, that only serves tiles in UTM zone 32. Hence my Leaflet map is created in UTM zone 32 by utilizing Proj4 functionality. The problem is, that my necessary coverage area extends well into areas normally covered by UTM zone 33.
Whenever I zoom into an area belonging to UTM zone 33, the map starts scrolling downwards without any apparent cause. And it keeps scrolling, and there seems to be nothing I can do to stop it.
Furthermore, panning and zooming is severely inhibited in this area. I've tried to increase the map maxBounds a lot into zone 33, but it doesn't change anything.
There are no such problems whatsoever when working in the normal zone 32 coverage area.
Can anybody help me in how to get this unwanted scrolling to stop ? Or at least give me an idea as to where I should start looking for a solution ?
Regards,
Lars I Nielsen

Related

Mapbox doesn't cluster at top level zoom

I have copied the mapbox example from here;
https://docs.mapbox.com/mapbox-gl-js/example/cluster-html/
When I run it from my server though the map loads, but clustering doesn't seem to work.
If I zoom in, I see the individual records, but no zoomed out clustering. If you zoom in enough around Spain you will see the records.
http://75.9.250.45:8011/mrcjava/servlet/SQL_CT_01.I00090s
I have simply copied and pasted the code from the example into my own html, so I'm unsure why it would behave differently than the example does
This was due to freemarker causing errors with some of the code. Wrapping these as per the below solved it
${r'${w}'} instead of ${w}.

Amount of requests on mapbox tile using flutter_map

I have recently implemented the flutter plugin called flutter_map, using the Mapbox tiles, and would like to know how you guys manage to count the network requests for the Static Tiles. Is it supposed to make a request for every move (zoom in, zoom out, move around, etc.) on the map itself? Is that the intended functioning or is there a way to diminish the number of requests made?Amount of requests made after zooming/panning
Is it supposed to make a request for every move (zoom in, zoom out, move around, etc.) on the map itself?
Yes indeed. The package supports static raster tiles, which means they must be re-downloaded if they change - such as on move or zoom events.
There isn't much in the way you can do about this, as it's a kind-of standard. This is why you'll find a similar thing in other mapping libraries, such as Leaflet.js and others.
See https://docs.mapbox.com/api/maps/static-tiles/ for potential ways to reduce costs whilst maintaining standards.

Two cursors on maps at same time in Mapbox GL-JS

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.

With Leaflet markercluster, how can I switch between clustered and unclustered without changing zoom level?

I am using the Leaflet.markercluster plugin to cluster my points.
However, users are asking for the functionality to switch between clustered and unclustered views (basically, they want to see all their points at a high zoom).
I know that I can disable clustering at a specific zoom level:
markers = new L.MarkerClusterGroup({
disableClusteringAtZoom: 8,
})
How can I force everything to uncluster when I am further zoomed out, though?
You would probably be interested in Leaflet.MarkerCluster.Freezable plugin.
It provides extra methods on Leaflet.markercluster, including disableClustering() and enableClustering(), which enable you to uncluster / cluster programmatically (e.g. on a button click) without needing the user to zoom in/out.
See also the plugin demo page.
Of course, you should be careful whenever you call disableClustering(), since you may instantly load all your markers on map (if you are zoomed out to their full extent). If that tries loading thousands of markers, you may freeze your browser or even crash it.
Disclaimer: I am the author of this plugin.

Using tiles as texture when zooming in on Object in Unity3d

I have a problem with an smartphone (android so far) app I am programming in unity3d.
I got the following set up:
I have a sphere on which, so far, I have a texture of the world. It's resolution is already set to the maximum but when I "zoom in" on it it just looks disgusting. I'd like to reload texture tiles like in Google maps to have a higher resolution without having a too big impact on the memory. Is that approach a good one at all? And if so: how do I do that?
Haven't found the right things so far or I just got them wrong.
EDIT: As some people probably get me wrong I try it again with some more details.
What I am trying to set up is the Earth as a sphere with a map. That map is okay as long as you dont zoom in too far, which is obvious because of the textures finit resolution. Now, to still have good graphic quality, when being zoomed in that far that one could see streets in a city I want to load additional "satelite pictures" like Google Maps does it (you know: you zoom in and Google Maps always reloads the images in that specific area to still provide a good graphic quality). How do I achieve that specific behaviour? Providing all the tiles i need is no problem, I got a Vector Graphic from which I could export all the needed tiles, but i don't know how to reload those tiles when zooming in at that specific area (to reduce memory consumption, drawcalls, etc).
Any help is really appreciated as I am a beginner in programming with unity. Thank you very much in advance!
Dustin
Are you actually zooming in or moving the camera physically closer? Unity has some internal filters that make textures easier to load at a longer distance. When zooming, the camera isnt actually moving closer meaning the more detailed version of it will not load correctly.
Also check your Max Texture Size setting for the texture you are using. Maybe it is turned down too low. Try turning it up to a higher resolution.
If it still looks blurry up close with Max Texture Size turned higher, your texture may not be high enough resolution to begin with. Make it a high enough resolution that it looks good up close. Then begin lowering the Max Texture Size resolution until up close it is "good enough".
Next, typically, it will start looking blurry in the distance or have distinct linear transitions from looking good to blurry. You can fix this by turning up the Ansio Level. Use this with caution because it increases the rendering load. Only use what you need, especially for mobile games.