Ofx + google maps

Hi,

I am looking for to load map image data based on given longitude and latitude from google map.

and I am trying to move around from the initial map image to explore around the world.

Question:
Is there ofx addon for google map so I can load image / get longitude and latitude from it?

or should I be able to read buffer from

http://maps.googleapis.com/maps/api/staticmap?center=40.714728,-73.998672&zoom=14&size=400x400&sensor=false

?

did you searched ofxaddons.com?

I did this addon time ago: https://github.com/kalwalt/ofxOsgEarth , it can also import google maps into .earth files if i remember well…) go to http://osgearth.org/ and https://github.com/gwaldron/osgearth for more info.

1 Like

this example load a google map using bing in windows https://github.com/gwaldron/osgearth/blob/master/tests/bing.earth
see also http://forum.osgearth.org/Streaming-Google-satellite-Map-data-in-osgEarth-td7581315.html

Notice that with osgEarth you can import also OpenStreetMaps in case you would be interested…

Sounds perfect for me. Will test it right away.

i did ofxOsgEarth addon with OF 073, i think could be some issues but maybe not, do not hesitate to post issues i will help you if i can and if i’m able to.

It complains about ofMain.h even though it is under myApps folder.
I guess I have to manually add search path to it?

maybe because the example use old style coding? try to delete the #Ifndef in testApp.h to #pragma once id est:

#ifndef _TEST_APP
#define _TEST_APP

//all the code here

#endif

change to at beggining of testApp.h

#pragma once

Did you create the project with PG or what? and in which OS are you working?

That helped with ofMain.h issue but I guess my osg lib was not installed properly.

It gives me error saying ‘use of undeclared identifier : osg’

Also, I guess the temp folders for Addon ofxOpenSceneGraph has empty folders.
I am trying to fill in with lib and downloaded osg 3.1 and it has lots of folders in there. Should I copy all of them folders e.g. ‘include’ , ‘src’, ‘packaging’ and etc?

OS is 10.9.2 btw

Thank you Kalwalt.

i works primarly on linux, never had a Mac. but i think you should copy all the frameworks and plugins in the ofxOpenSceneGraph addon lib. you should follow the procedure described here maybe @sth may help more in this sense.

OSG seems to be too heavy for my project.

All I need is square image of map according to Longitude and Latitude.
Would there be any helpful work around to it?

http://maps.googleapis.com/maps/api/staticmap?center=40.714728,-73.998672&zoom=14&size=400x400&sensor=false

Loading image with above code with ofImage seems to work but it is too slow to NAVIGATE.

Some guy tried Chromium to have navigateable map into of but I am not familiar with it yet.

Any suggestions would be appreciated.

Understood. @vanderlin also did this addon time ago, didn’t load google maps but use longitude and latidue coords.

I’m almost done updating this addon for adding maps from lots of places:

1 Like

Thanks guys. will implement these and test today and let you know.

interesting addon @bakercp!

hey @fkkcloud, if you still have this issue with the ofMain.h try creating a new xcode project. I don’t know why it happens, it seems to be related to some sort of project file corruption. It happens to me quite commonly and this is the easiest fix I’ve found.

@bakercp Working great. Will test more and let you know!

@bakercp

So, current command to draw map,

map.draw();

above command will draw the map for entire resolution of the map.

Would it be possible to have something like below command,

map.draw( POSX, POSY, POSZ, HEIGHT, WIDTH );

So I can draw the map as an object in 3d space?

To draw in 3d, you’ll probably need a camera and you can draw into 3d space
with

// cam.begin();
ofPushMatrix();
ofTranslate();`
ofRotate();
/// draw
ofPopMatrix();
// cam.end();