I would like to show maps within Codea, I also have techbasic on my IPad which has a mapview feature, can this be implemented in Codea or does anyone know how to view the map within the codea application.
@Andy_Faulkner Yes it can be done and already has. There’s examples on the forum, but I haven’t been able to find them. What kind of map do you want to show and where do you want to get them from.
Hi Dave, techbasic seems to use the Apple maps, what I want to do is show the current position from ios location services and plot points on the map when the location changes
@Andy_Faulkner Here’s a simple example I found on the forum. I’m sure it can be expanded to do a lot more by passing variables within the http request.
displayMode(FULLSCREEN) function setup() map = nil http.request('http://maps.googleapis.com/maps/api/staticmap?center=40.714728,-73.998672&zoom=10&size=800x800&sensor=false', didGetImage) end function didGetImage(theImage, status, head) map = theImage end function draw() background(226, 226, 226, 255) if map ~= nil then sprite(map, WIDTH/2, HEIGHT/2) end end
@Andy_Faulkner You can use Codea’s location functions to get the latitude and logitude values and plot those on the map. It will take a little math, but should be easy enough.
Hi Dave, thanks for this information, yes the map shows up on the screen, and yes I have been using the location service, the thing with techbasic is that you can scroll around the map, enlarge it and make it smaller with ease, however the codea interface is excellent, hence why I would prefer to use codea.
I shall have a look at the google map api, but would prefer to use Apple maps as I think techbasic gets the information though the Apple maps app i.e. Uses the data from Apple maps
@Andy_Faulkner Using Codea you can also zoom in or out, change the initial location, and move the map around. It’s just a matter of changing the values within the http request and adding more code to the example I show above.
Ok I will look into this, thanks for your help