Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Pretty basic MapView crashes on Android, glitches a little on Iphone
Started by henrik5 Jan 16 2014 06:19 AM

33 replies to this topic
[TOPIC CONTROLS]
Page 2 of 2 1 2
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#26

ksan

[GLOBAL: userInfoPane.html]
ksan
  • Corona Geek

  • 2,795 posts
  • Corona SDK

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. 



[TOPIC: post.html]
#27

mpappas

[GLOBAL: userInfoPane.html]
mpappas
  • Contributor

  • 527 posts
  • Enterprise

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



[TOPIC: post.html]
#28

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 25,895 posts
  • Enterprise

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. 

 

Rob



[TOPIC: post.html]
#29

mpappas

[GLOBAL: userInfoPane.html]
mpappas
  • Contributor

  • 527 posts
  • Enterprise

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.



[TOPIC: post.html]
#30

ksan

[GLOBAL: userInfoPane.html]
ksan
  • Corona Geek

  • 2,795 posts
  • Corona SDK

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. 

 

Rob

 

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. 



[TOPIC: post.html]
#31

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 25,895 posts
  • Enterprise

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. 

 

Rob



[TOPIC: post.html]
#32

ksan

[GLOBAL: userInfoPane.html]
ksan
  • Corona Geek

  • 2,795 posts
  • Corona SDK

I think onComplete for map loading would help in other ways. It would allow us to be offer better user experience. Same with webViews. We need to know when loading has ended ideally.

[TOPIC: post.html]
#33

nmichaud

[GLOBAL: userInfoPane.html]
nmichaud
  • Contributor

  • 492 posts
  • Corona SDK

How did it work for you? Any ways to improve it? Thanks for sharing. 

 

@ksan, we have been busy with our new version and I did not have time to try it yet. I will do it as soon as possible :)



[TOPIC: post.html]
#34

ksan

[GLOBAL: userInfoPane.html]
ksan
  • Corona Geek

  • 2,795 posts
  • Corona SDK

Sure thing. Not to worry. I will look forward to hearing of your impressions. Either way the current mapView implementation by Corona Labs leave a lot to be desired. I hope they have a chance to revisit this API soon to fix existing bugs and implement many missing features. 




[topic_controls]
Page 2 of 2 1 2
 
[/topic_controls]