Map Layer Ordering

31 views
Skip to first unread message

JP Le Riche

unread,
Jul 29, 2019, 1:28:01 PM7/29/19
to MIT App Inventor Forum
Hi,

I love App Inventor and have built some pretty cool apps.

I do have a problem at the moment with the layering on maps. 
There is Marker element that I update with GPS position and direction(custom icon).
Then there are loads of line elements AS WELL as a FeatureCollection.

My problem is that the marker is rendered underneath the lines and FeatureCollection. The Lines do render on top of the FeatureCollection, which is correct, probably by accident.

Any idea how I can change this and get the marker to show on top of the other elements?

Thanks
JP 

SteveJG

unread,
Jul 29, 2019, 1:41:51 PM7/29/19
to MIT App Inventor Forum

JP Le Riche

unread,
Jul 30, 2019, 3:16:13 AM7/30/19
to MIT App Inventor Forum
Hi SteveJG,
Thanks for that answer. That works between multiple Feature Collections and between multiple Map Feautures.
BUT the Feature Collections are always above the Map Features, no matter when I load a Marker or Line, it always appear below the Feature Collections.
Please tell me there is some way of correcting this.

SteveJG

unread,
Jul 30, 2019, 8:08:52 AM7/30/19
to MIT App Inventor Forum
Managing the order requires a bit of experimentation JP.  What actually has to be done depends on your code and where you attempt to implement each object.
Explaining this is like explaining to someone how to tie a shoe string.  Difficult to learn with only verbal instructions.

Without a copy of your code the best advice is to try ordering events differently.   A certain amount of experimentation is required on the part of the developer.   It may not be entirely possible to do exactly what you hope to do.  The Map component merely is a link to the OpenStreetMap api.  Some of what you see happening is a result of communicating with the OSM tile server  If you have lots of lines and Markers and  what you place in your FeatureCollection you may have difficulty managing different kinds of objects. Most things with the Map component are easy to do, ordering the display of lots of objects is not.   I have been successuful following Evan's advice.

Follow Evan's advice .  Exactly what you need to or expect to happen might not be possible.

-- Steve
Reply all
Reply to author
Forward
0 new messages