How to solve problems with offline map display? - leaflet

There is one problem: I made it using maperitive tiles with the required scale of 12-15 (so that the map is available offline), then the task was to connect the resulting offline map to this project: https://github.com/ds4es/real-time-units- gps-tracking (the project is based on transferring data using kafka from a csv file, which contains latitude ,longitude time, to a map with the leaflet plugin, to display the real-time movement of markers on the map), however, this did not work, apparently some are required - something http requests, not just a link to tiles. I want to note that a similar way of writing: file:///home/jonh/openstreetmap/{z}/{x}/{y}.png worked in another project, but unfortunately not in this situation. Attached images below
The 1st figure shows the state of affairs when adding an offline map ( line: MAP_URL_TEMPLATE=' Tiles/{z}/{x}/{y}.png) and, as we can see, only moving labels are displayed, and the map itself is not displayed;
2nd figure Shows the state of affairs when the online map is used, i.e. constantly need internet to display it;
The 3rd picture shows the console, where, before the red line, an offline map was used (Tiles/{z}/{x}/{y}.png). And after the red line, I changed the address to the online map again: 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png' and the map started showing up all over again.
How can I connect an offline map? Thanks for answers :)

Related

TileOverlay requests tiles after it was made invisible [maps 18.0.2]

Note: problem appears when using MapsInitializer.Renderer.LATEST
Goal: I am using several tile overlays in order to switch the data user sees above the map. Several overlays needed to avoid flickering that user sees when we clear the overlay tile cache if using single overlay. For example: showing different weather data depending on the selected time moment.
Steps: When I add a TileOverlay I make it invisible with TileOverlay.isVisible=false right after map.addTileOverlay. Also added some logs to see when the TileProvider actually requests the tiles.
Problem: In the logs I see that overlay requests tiles when I move the map or change a zoom level. Previously the TileOverlay was not requesting tiles if one is set to invisible.
Demo app source code is here https://github.com/olkazmin/googlemaps-tileoverlay-sample.git
Pixel 3a, Android 12
Google Play Services client library version: com.google.android.gms:play-services-maps:18.0.2
Google Play Services version on the device: 22.06.15
compileSdkVersion 31
buildToolsVersion 31.0.0
All was working ok in com.google.android.gms:play-services-maps:17.0.0. Everything works as expected when using MapsInitializer.Renderer.LEGACY

How do I create a test app to create many screenshots in UE4?

I'd like to create a test application for my Unreal Engine based game to create screenshots. I'd like to place many (possibly thousands) of cameras throughout the maps and then have my test application enumerate them all and take a screen capture at each camera location.
I came across Taking Screenshots, but wanted to first check to see if this isn't already built into UE4 in the editor, or some tool. I'm also aware of the Screenshot Comparison Tool, but that doesn't seem to be what I need because I don't really want to use UE4 to do the image matching, but instead just want a directory full of images that I can do with what I want.
Any suggestions?
This is not directly what you want to do but I found this article very interesting: https://www.unrealengine.com/en-US/blog/capturing-stereoscopic-360-screenshots-videos-movies-unreal-engine-4?sessionInvalidated=true
It explains how people at Ninja Theory Ltd proceeded to produce their 360 video trailer which is, in the end, producing two 360 screenshots per frame.
So what they did was having everything exported in a folder (as a sequence of images) and then did what they wanted with it. (In this case put them all together with ffmpeg to make a video)
They used a plugin, I do not know if it can be tweaked not to make 360 captures but the built-in "take screenshot" from UE4 could work for you.
More specifically to what you need, you could probably store all positions/transform in an array, loop over it when you want to make the screenshot. Each step, you place your Camera at the specific position, make sure it is the current active camera to change the "view" and take a screenshot.
Taking screenshots and setting parameters such as export folder, resolution etc. ... can be called via console commands and console commands can be executed from code or blueprint using the "execute console command" node (there is an example in the article).
I hope it helps.
I think the best bet you have is rendering camera to a texture.
this way you can have multiple inactive camera then iterate through them, activate them, capture their screen view and going to the next one.
for basic tutorial have a look at
https://www.youtube.com/watch?v=a9iho861SlY

Bing Maps with pins and cluster loses click handler and has bad performance

I have a Bing map with pins and clusters.
I noticed performance issues and bugs in this combination. I have setup a demo using code from the official docs.
1st issue: Pins click handler are not clickable anymore after zooming
Steps to reproduce:
Load the above demo
Hover over a single pink pin => its clickable (cursor is hand/pointer)
Click on the + button to zoom in
Some of the single pink pins are not clickable anymore (cursor is default)
2nd issue: Really bad performance when the map is initialised
It looks like this is caused to many, many _initiateRequest, _setImage or downloadImage calls within the Bing Maps JavaScript. See this perf screenshot taken with Firefox Performance tool:
This performance hog drops to about the half if no icon param is passed, that is, in the demo this is commented out so that just the default Bing Maps icons are used:
cluster.setOptions({
// commenting this out improves performance
// icon: svg.join(''),
anchor: new Microsoft.Maps.Point(radius, radius),
textOffset: new Microsoft.Maps.Point(0, radius - 8)
});
N.B. in the demo only the cluster has a custom icon setting. The performance gets much, much worse if also all the pins get a custom icon setting. It does not matter whether the icon is SVG or PNG, both are really bad performance and the Bing Maps seems to trigger DOM events and old browsers like IE11 even hang for several seconds.
Try using the experimental branch. There has been a ton of updates added to it which address these issues. You can try it by adding "&branch=experimental" to the map script URL. The main release branch will be updated with the updates in the experimental branch in the next 2 weeks.

MKMapView, 15k annotations

I have a list of 15k I need to display on a MKMapView embedded in my app.
I think this is probably too many to load at once, and I want to check if there is a standard way to do this. The XML file with the informations about the pins is stored on a webserver.
I think I have a few options, but still I'm not sure where the bottleneck would be (network, displaying many pins at once, loading the pins on the map the first time, etc):
Parse the whole xml file and add all the annotations. Force the user zoom so you can't see too many pins together
Parse the whole xml file and add all the annotations. Use a library for grouping the Pins.
Load only the top 50 pins in the area the user is currently in. Everytime the position is updated call a script on the webserver that only serves 50 positions based on map latitude-longitute and zooming.
Cache everything in coredata and do the same as the previous point.
Any considerations about performances I should do? Any other solutions? Will these perform well enough?
Thanks!
The bottleneck will be displaying that many pins at one time on the map. You shouldn't display more than around 500 at one time. Zoomed in might be OK, but zoomed out will affect performance and map visibility.
Here's a library that will do clustering for you:
http://applidium.com/en/news/too_many_pins_on_your_map/

MKMapView Cannot Zoom Map

I created a really basic app that just shows an MKMapView and the UserLocation. I'm having problems drawing this base map sometimes (it only shows pieces of the map), and whenever I pinch zoom the map, it fails to redraw, and just shows the blank gray tiles. The console shows this whenever it needs to get a new map tile:
/SourceCache/GoogleMobileMaps/GoogleMobileMaps-263.5/googlenav/mac/Loader.mm:231 server returned error: 502
This looks like a gateway error, but that doesn't make any sense, since I'm using open WiFi for testing. I haven't implemented any region zooming code, I just want to display and zoom the basic map first. I'm using iOS 4.2.1 (8C148), so I'm wondering if this is a problem with the newer iOS versions? Any ideas?
Edit: Works fine now, must just be a problem with Google's servers.
Just started getting the same error. I've searched online and can't see anyone else having the issue (yet). Thought it was something I did, but suspect its at Google's end.
I think that the problem is solved now. It had to be a momentary Google Maps problem.