http.request + Google Static Map API

I’m probably the last person in the world to figure this out. But just in case, give this a try…


function setup()
    map = nil
    http.request(',-73.998672&zoom=12&size=400x400&sensor=false', didGetImage)

function didGetImage(theImage, status, head)
    map = theImage

function draw()
    background(226, 226, 226, 255)
    if map ~= nil then
        sprite(map, WIDTH/2, HEIGHT/2)

Pretty spiffy. And if you look at the static maps API, you’ll find there’s a lot you can do with it.

Now, imagine if we had the compass heading and GPS values. We’d be well on our way to our own Codea-based mapping tool.

Yes, a little bit late, but it’s a good time to remind us about “old” code:

Anyway, a nice compact example of Google maps access.

.@mark thanks for the nice piece of code.