Only Map1.Maptype=1 works for me.
Map1.Maptype=2 or 3 produce empty map with squares
Is this normal?
Only Map1.Maptype=1 works for me.
Map1.Maptype=2 or 3 produce empty map with squares
Is this normal?
Working OK here.
Test with the default coordinates that load when you add the map component.
Could be a slow internet connection ?
If you are using different coordinates it is possible that 2, 3 are not available for you location?
Tim identified the probable issue. The Aerial and Terrain are not usually available for higher value Map tiles when using OSM. Try changing the Map type while using a zoom of 10. What happens? If you are zooming at 18 or so, you will not have 2 or 3 available.
Unlike GoogleMaps map tiles; OSM (the map engine the Map component uses) does not provide images other than Roads for all zoom levels.
Regards,
Steve
Thank you all.
I am making more tests and sometimes i have problems also with MapType=1… when zooming back a lot the screen refresh freezes… and it stays frozen.
So what’s the way to use Map1. If it works in this way it means it doesn’t work
Nobody ever complained before me ?
The Map component uses OpenStreetMap tile servers. The OSM servers do not have unlimited capacity. Their use is load limited. If there are many users, sometimes changes to your Map during periods of high server load take longer to render. Response also depends on your device
WIFI or network connection. Whether you have a slow network or WIFI affects ability to render tiles since the map tiles are in the Cloud, not on your device.
So when you 'when zooming back a lot the screen refresh freezes… and it stays frozen."... just do not do that. Make your zoom changes slowly.
OSM works exactly as designed; if you want faster response, use Google's Google Map Static Map. Static Map uses Google's servers which are significantly faster and responsive compared to the 'donated' servers used by OSM.
"Nobody ever complained before me" ... this behavior is a known issue with the way OSM works...MIT App Inventor 2 has no control over OSM's servers. The Map component merely provides a link to OSM.
To learn about how OSM tiles 'work' and especially about high usage.
very clear! thanks
last question can AI2 use Static Map?
Yes, AI2 can use a Static Map.
Points to be aware of:
The following blocks are a partial port of Google’s example to AI2 Blocks
It will produce a map like:
Here is an example of a StaticMap using the LocationSensor and centered on the device’s geocoordinates
These examples should get you started.
A simpler way to use Google Map tiles might be to use the third party, commercial Block clone called Thunkable. That compiler has a Map component based on Google Map tiles. It might do what you want.
There are many StaticMap examples in the old AI2 Forum which although deactivated, can still be searched using terms like static map. Here is a tutorial
.
Have fun experimenting.
Regards,
Steve
your tips are so helpful!
thanks and compliments
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.