Ok, we will try it under iOS and will get back to you soon
How did it work for you? Any ways to improve it? Thanks for sharing.
Jump to content
Just some FYI: I'm seeing the same issues with disappearing android map markers. It definitely is related to two calls - setMapRegion (changing the map view area, which causes google maps to load new map textures - which introduces a delay in drawing the new map), and in the removeAllMarkers call.
If you make an addMarker call too soon after either of those calls on android, you run a good chance of no marker appearing on the display. You may also run into issues (when the timing is close, but not quite good enough), where markers do appear, but are malformed in some way, such as zoomed up (and clipped, so you see a large 1/4 of a marker), or even "ghost" looking (as if the alpha is at 0.05 or something). I'm guessing that when they aren't there at all, it's probably a variation of one of these two visual edge cases -- ie; when it's missing, it's totally at the wrong scale and only transparent pixels are showing from the markers top left corner, or it's alpha is messed up.
In any case, I'm seeing this bug pretty consistently on the galaxy S3 running 4.3. If the time between the removeAll (or a big view change using setMapRegion), and addMarker is less than 500ms, after a few cycles changing maps/removing markers, it's messed up - no markers/malformed markers. Delays of 750ms or more, it works better / more consistently. (This may be related to google maps code having to contact the google server to get new map info, but the corona code moves ahead adding markers before google changes the map properties??)
This in on WiFi. The delay has to be even longer over the cell net
That sounds like it would work for me, or:
- if the SDK buffered the requests, and processed them after the map finished.. (difficult no doubt)
- or if the sdk kept a local copy of the apps requested new mapView area, so it could get it's newMarker positions/scales correct while google does it's thing... (presuming something along those lines is the problem) This might not be so hard...
iOS works well, but I'm guessing they handle a lot of the map data locally (the view area for instance), and modify it there, so there's no timing issue.
I'll check with engineering and see if it's possible to add a call back function to the native.newMap() API. Seems that you need to know when it's complete to start adding things.
That would be amazing! Thank you very much for your follow-up. We are literally shooting in the dark not knowing when map loading is complete.
After talking to Engineering about this, while it's possible to have an onComplete type features, they don't believe this will help. We already queue actions to Google. In simple terms, we don't add the map points until the map is loaded. They have seen this behavior in the native maps app and it seems to be a rendering issue on the Google side. Zooming in and out seems to solve it. You might be able to simulate this using the setRegion() call.
Community Forum Software by IP.Board