TileOverlay requests tiles after it was made invisible [maps 18.0.2] - google-maps-android-api-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

Related

How to solve problems with offline map display?

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 :)

How to load dataset in Unity fom Vuforia dynamically?

I'm building an augmented reality app, so far, for each new marker I had to add to my Vuforia dataset, download it, put it in Unity, create the imagetarget and build the app again. This is very labor intensive, and delay the addition of new markers, because the time between I update it at PlayStore/App Store can take several days.
What I'm trying to do is a way that I can either load all my markers from the cloud (Tried that, with 2 markers some weird bug started happening) or when I open the app, it'll download the dataset with all the markers, create each image so that no matter how many markers I add or remove, all of them will be there at anytime the app is opened.
Use Cloud Recognition Service From Vuforia:
https://library.vuforia.com/articles/Training/Cloud-Recognition-Guide
and here is a tutoria how to use it :
https://www.youtube.com/watch?v=ILVpISTEcx4

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.

Unity Google Street View

I am trying to make a street view 360 viewer. Which should work on 2 screens.
One is a monitor and one is a oculus rift.
The first user will be sitting in front of the monitor and selecting street view images from a list / database.
The second user will wear the oculus rift and can see the street view images.
There is a plugin that can download panoramas from street view https://www.assetstore.unity3d.com/en/#!/content/28512 ,
but this will only work in the unity editor.
Well here is the problem. I need to update this programm once in a while. So maybe there will be new images every week, the user should be able to select them. If they start the programm, there will be a screen saying that there is an update available. The programm should than download all new images and after that, they will be available for the users.
So I am wondering if it is possible to download panoramas from street view in runtime? Like there will be a database with all url's to the panoramas, the programm will check that database, download all new one and convert them to skybox oder 6-sided pictures.
Thanks.
I am using unity 5.4 and it should work on a PC
You can download the images using the Google Street View API: https://developers.google.com/maps/documentation/streetview/?hl=en
Example URL:
https://maps.googleapis.com/maps/api/streetview?size=600x300&location=46.414382,10.013988&heading=151.78&pitch=-0.76&key=YOUR_API_KEY
Please not that the images will be 400px * 600px, to get higher resolution you'll have to pay.
You'll have to make a different request for each camera angle (the max allowed FoV is 120, meaning you'll need three images to make the whole horizontal circle).
Honestly, I would do the whole image managing and updating thing server side. I would set up an interface in the browser where you can add new interest spots, then the server downloads the images and creates the cubemaps. The Unity client will just ask the server for a list of all the interesting places and once you chose one it will download the cubemap. Maybe it's because I have a web dev background, but to me it makes more sense than doing everything inside Unity.

skmaps in mobile is slow

We use the skmaps's(Skobbler) SDK in android and IOS,
Our function is to show one pin in skmaps, the other settings is default.
We can show the map on both android and IOS,
but the loading time is too long, it takes about 5~15 seconds.
I've been trying different Wifi network and different device(iphone 6s plus and HTC M9), but it's still slow.
Can anyone help me?
The SDK doesn’t seem to be slow at rendering.
So check the downloading process for the requested vector tiles.
How to improve it:
reduce the requested area - increase the zoom level so that as soon as some vector data becomes available something will get rendered (i.e. set the zoom level to 18 or 17)
reduce the size of the requested vector tiles - switch to using LightMaps (initMapSettings.setMapDetailLevel(SKMapsInitSetti ngs.SK_MAP_DETAIL_LIGHT) - the light maps contain fewer elements and thus are smaller and will be rendered faster
don't use pannable maps but use static maps when displaying the location of a certain POI - for this exact use case, showing a mini map associated with a POI most products use a static map (fixed png/jpg) as it renders instantly. This is especially relevant in scenarios when the POIs are in different parts of the world