Examples of using a hand-drawn map instead on native MapView / Mapbox?

Hi!

I’m making my very first Solar2d mobile app. It’s a guided tour in the center of my hometown.

To avoid Google Maps usage fees on Android, I was thinking of using a hand-drawn map image instead of native MapView. (Or Mapbox).

The idea is to use the GPS location event listener and move the map image on the screen based on user’s location.

Has someone already done something like this? Can you point me to any examples?

I’m not exactly sure how I’m able to sync the latitude/longitude values with the hand-drawn map image this way… Any hints welcome!

You could split the map into a fine grid and assign lat/long coords to each cell.

Or maybe you will be able to do this via some maths if you know the coords of top left and bottom right. It then becomes simple extrapolation.

Ok, thanks! Sounds pretty staightforward.

Meanwhile I checked out Google’s map API pricing for mobile, and I got the impression the mobile map API is free:

So, I could use the native map API after all?

To answer my own question: no. The requests made with Solar2d native MapView are listed as the non-free “Maps JavaScript API” calls at Google. (See the attached image below.) You get free calls for 300 € when you register, but that gets used pretty fast.

Damn. So, need to do the hand-drawn map pic anyway.

Naively I expected the Solar2d native map api requests to register as “Maps SDK for Android” calls – which would be free of charge – but no. I wonder why it’s this way, tho.

I’m not familiar with Google Maps API, but if it’s free through their SDK, then you could implement it via Solar2D Native or native plugins.

Seems to me it’s free only if you use Android SDK.

If you take a look at their API pricing in the link you posted, it does state that it’s free for Maps Embed API, Maps SDK for Android and Maps SDK for iOS, etc.

Like I said before, I don’t know how Solar2D’s plugin is done, but you should be able to integrate them for Android or iOS via Solar2D Native.

Also, partly off topic, I’m wagering a guess that you are Finnish? It’s been a while since there’s been more than one Finn on the forums.

Welcome! :finland:

That’s exactly what I thought before I tried it out.

Take a look at the screenshot I posted. The requests from my Solar2d app in development get listed under “Maps Javascript API”, not under Maps Embed API, Maps SDK for Android or Maps SDK for iOS.

That usage is not free, tho you get some free credit when you register as Google Maps developer at Google.

Yeah, from Turku, Finland. Thanks! Nice to join the Corona/Solar2d community.

Whatever happened to the Map plugin, btw?
https://marketplace.coronalabs.com/corona-plugins/map-plugin

It was still available a couple of weeks ago. Provided OpenStreetMap support & wasn’t too pricy.

That is a part of the old Corona Labs Inc.'s website. That company has since shut down and Corona has transitioned to Solar2D. There’s still more rebranding to do and websites to edit, etc. but essentially all old Corona Labs content/services, like their marketplace, is gone.

These days you’ll find plugins from:



I’m not sure if any of them have map plugins though.

But, you’d need to get the Maps SDKs for Android and/or iOS and handle their integration to your project by yourself. Alternatively, you could take a look at the source https://github.com/coronalabs/corona/search?q=mapview and see if you can figure out why it’s making calls to JS instead of the free API.

Thanks.

There’s the Mapbox plugin… https://solar2dmarketplace.com/plugins?MapboxPlugin_tech-scotth … but using Mapbox is only free up to 25000 monthly users. Might be enough, but who knows.

Alternatively, you could take a look at the source https://github.com/coronalabs/corona/search?q=mapview and see if you can figure out why it’s making calls to JS instead of the free API.

Yeaah well, that’s over my skill level. :stuck_out_tongue: