No Marker No Party :)

We actually render maps via a WebView on Android.  We do this because not all Android devices support Google’s native maps because there is a licensing/royalty cost that the manufacturer would have to pay.  Case in point, the Kindle Fire tablets.

We actually hard coded are maps implementation to use version 3.9 of Google Maps.  This was to (theoretically) avoid any breaking changes that Google may make in future revisions since at the time that version passed all of our Google Map tests.  That said, I suppose it could still be possible that Google might have accidentally introduced a breaking change to that version unintentionally, because I don’t recall the above mentioned issues being a problem before.

mpappas, since you’re an Enterprise user, then you can actually see the JavaScript side of our map implementation for Android in case you’re curious of how it works.  You can find this file under…

   ./CoronaEnterprise/Corona/android/lib/Corona/res/raw/corona_map_view.html

Most developers use the map’s “idle” event to determine that the map has finished loading, which is what we use.  I’ve never seen it fail actually and I’ve tested under extreme conditions such as zero internet access and loss of Internet access.  The markers are drawn locally to the canvas and I don’t believe it involves a request to the Google Maps servers.

So, were you only seeing this issue when executing these operations on startup or when first creating the map?

Or is this marker issue happening sporadically at runtime?

OK, got the random / sporadic malformed pin bug… On this map I had added 5 or so pins, and only 1 showed up (boston area). It is scaled a little too big for one, and the alpha looks like 0.05 or something, so you have to squint a little, but you can tell 1 pin tried to show up (boston area)…

http://www.vipah.com/GalaxyS3Pins.png

No idea if this is related to the "no pins’ at all issue… 5 pins were added to this map. This happened after a10 minute testing session, and then downgrading the connection from wifi to cell… A few more minutes, and then this screen showed up.

That faint marker pin suggests that this is a rendering bug with Google Maps that we have to work-around.

And you’re saying that zooming in/out doesn’t resolve it, correct?

Does tapping where the markers are supposed to be cause the annotation to appear/disappear?

I’m not sure what else you can you do to force it to render.  In my experience, panning the map won’t force a redraw.  I’m just trying to think of some ways to force Google Maps to work and provide you a work-around… because so far, it looks like we are successfully adding the markers to the map, but Google Maps is sometimes failing to draw them.  *sigh*

The mapMarker issues on both IOS & Android are very challenging. In this case can you kindly confirm if you were using custom marker images or relying on what the OS supplies? I just found some weird behavior on IOS when I supply the markers. Android seems to be immune to that issue. 

@Joshua – I didn’t try zooming on that screenshot :(   On the cases where no marker shows, zooming and tapping markers does produce results – darn, wish I tired on the malformed marker… Been testing for another 30 minutes, and haven’t repeated the malformed marker again. But the pins stopped appearing on some maps (once they stop, they never come back on those mapviews without relaunching app).

Going to test some more, and see if I can get another malformed one and try zooming, tapping to see if it affects it (which would mean it is a different bug, for one thing).  I’ll repost in this thread if if there’s anything more I can find out to chew on. Thanks for all you help Joshua!

@ksan  This on an s3 running droid 4.3. More details are:

  • Default markers

  • I’m using 5 mapviews, making various mapviews invisible as the user switches screens (to save initial loading times later)

  • Markers typically added after a removeAll() and setRegion() call

  • Ocasionally seeing a malformed marker (like the image above)

  • Somewhat more frequently having no pins appear, once this happens, pins never appear again on that mapview (although others keep working)

Yikes. That sounds pretty bad. Almost as bad are the custom markers on IOS. See below : 

https://www.youtube.com/watch?v=la9-b4wWTpk&

That looks like a center positioning of the marker, but using a marker that requires bottom justification yes?  It seems to be scaling and rotating ok.

Yup. Don’t mean to pull this thread off topic but you are right. When custom marker is supplied it is not centered the same as OS supplied markers.

thanks to all expecially to mpappas!

the delay works fine!

good job

ksan, your iOS marker placement issue is a totally different issue.  Our team has confirmed it to be a bug and added it to the queue to be addressed later (no ETA yet).  I’d prefer to keep this thread focused on the Android issue mentioned above to avoid confusing matters.  Mostly because I think the Android issue mentioned can actually be work-around on your guys’ end so that you won’t have to wait for a fix from us.

maucel, mpapas, while adding a marker based on a timer might seem to resolve this issue, I bet you that it won’t always work.  Not trying to be difficult, but I’m quite positive that this is a rendering bug with Google Maps like I was saying above.  I say this because we ran into several rendering issues just like this that we had to resolve before releasing the first version of our maps feature on Android.  So, if it is a rendering bug like I was saying, then you can work-around it by forcing the map view to rescale via the setRegion() function.

mpapas, since you’re an Enterprise user, you can actually see our JavaScript code for our map view which I pointed to you in a post up above.  If you look at the script’s functions that removes markers, you can see where we’re working-around Google Map’s rendering bug there by rescaling the map, just like how I recommended in the above paragraph.  You see, during testing and before we released our maps feature, our testers came to the same false conclusion that removeMarker() and removeAllMarkers() would not always work… but it turned out that the markers were actually being removed from the map in memory but Google Maps would not always redraw its canvas, leaving the removed marker images onscreen.  The solution was for us to force a redraw by zooming in/out of the map, but so quickly that you would never notice it.  Kind of a pain really, but Google’s bugs are our bugs and we have to do what it takes to make it work.

Absolutely! I apologize for the off topic post.

No problem!  Since you’re working on maps anyways, I’m sure this Android issue affects you as well.  Like I was saying above, I’m quite positive that calling setRegion() will work-around the marker rendering issue on Android.  No delay via timers should be necessary.

Sure thing! The more the issues are looked into the better. Thanks for your efforts to help.