Google Map to OSMdroid - osmdroid

For a project at school we have to work on an android app. This project involves porting the app which is working with Google Map to OSMdroid in order to use openstreetmaps. Our method was to replace Google Maps classes by their equivalent in OSMdroid.
We don't know if it's a good idea as it's our first android project. But we are having troubles finding some classes, like the equivalent of the class Google Map (we've found IMap but it's an interface and we haven't found any class implementing it.)
So here is our question: Can our idea work ? If yes, do you know the equivalent to Google Map class in OSMdroid ?
Thanks for reading

Osmdroid is almost full replacement of Google Maps v1, so the idea of replacing Google Maps classes with their equivalent could be good idea if the first app using Google Maps v1 but with Google Maps v2 things are different.
But yes! most of Google Maps functionalities supported by osmdroid. However, you need to convert the app by looking for how to implement each function using osmdroid not by replacing classes with equivalent.
About the second part of the question. No, there is no one class in osmdroid that support all functions that Google Map class provides, but you can find most of that class functions in different osmdroid APIs.
For a good sample on how to use osmdroid take a look at OpenStreetMapViewer sample project https://github.com/osmdroid/osmdroid/tree/master/OpenStreetMapViewer

Related

Play Scala - Native access

I am developing an web application using the Play framework in Scala language. In my application I have to access the native methods which is written in C++ and converted into .so by using swig.
My aim is to call the native method which is in .so file from the Controller class. I have searched in the internet, but I didn't get any documentation for this.
I have seen some links which is used by scala language.
https://code.google.com/p/scala-native-access/
https://code.google.com/p/bridj/wiki/Download#Specialized_subsets_(smaller_JARs_!)
https://github.com/xudongyang/scala-native-access
But they didn't mention how exactly use this in the Play framework.
Can anybody have the documentation for Play scala native access?
Can anybody have the sample applcation for the same?
Like in any JVM language, JNA/JNI gives you native access. Be aware that because of Play's use of class loaders, you'll need to make sure you access from the same class. See fail to load a native library using activator (Play Framework)
This is hard to answer in general. Play! is just a Scala library and framework, some any tool that allows you to use native calls in Scala will work similarly with play. From the first link that you pointed to, there are instructions to integrate with SBT (the Scala Build Tool) which also manages your Play framework. You will need to make the changes they mention to your build.sbt file which you can find in the top level of your Play project folder.

Integrating Google maps with C++ Program

I am making an artificial intelligence based shortest distance finder between two points in c++ language. My coding for that is complete and working fine. Now I want to integrate it with Google Maps Api. I want to show the shortest distance graphically on google maps exactly same as google maps show directions. I am stuck and can't find any help. I know I have to do socket programming for this. Please guide me with proper steps and coding snippets. Thanks in advance!
Check out the official api :
https://cloud.google.com/maps-platform/
For interaction with the http api you could use a client such as curl (http://curl.haxx.se/) or maybe boost asio if your are using boost. see this question at SO: Boost.ASIO-based HTTP client library (like libcurl)
There is a c++ client/ helper available. Disclosure I have not tried it yet.
https://google.github.io/google-api-cpp-client/latest/
Many links seem to be broken (The samples directory link). So I'm not sure how well supported it is but it looks like it might be helpful.
The description page is at :
https://google.github.io/google-api-cpp-client/latest/start/installation.html
IF that fails there are samples in other languages that you may have to translate by hand. (better than nothing)
https://developers.google.com/api-client-library/

C++ Builder xe2 & Google Maps api

Can some one point me in the right direction.
I would like to create a C++ application that uses google maps.
I need to be able to do the following
Add markers.
Calculate distance between markers.
Work out long/lat from address.
Get address from long/lat.
Get address from mouse click on map.
I've seen some components that do this but they are abit pricy.
Not certain if this will help you, but Delphi & Google Maps API V3 is the first part of a multi part series on the same blog about using Google Maps API V3 in Delphi. Even if you don't know Delphi that well, you can see the names of components that are used.
Good luck.
Ended up using GMLib found at the following site
https://code.google.com/p/dcef3/
so far it has done everything i have needed.

What is the best way to integrate Google Analytics into a C++ OpenFrameworks desktop project?

I'm currently building an OpenFrameworks project and need to use Google Analytics to track user interactions. I have yet to find any existing C++ libraries for doing so, and am considering writing my own. Is the API open enough to allow a custom library to be created? If one doesn't exist, any ideas on where to begin coding my own?
Yes it is possible and easy to extend openframeworks!
You can look here if there is an addon which fits your need. Maybe ofxCurl or ofxHttpUtils are the right ones to create an request like the one mentioned in the comment by yahelc.
If you don't find a solution there, you can look here to find first informations about creating addons for openFrameworks. If you have any further questions, please ask in the official openframeworks forums which you can find here.
Looks like you'll have to build your own solution... I'd use ofxHttpUtils to ping Google's Analytics API. You should also consider wrapping your work as an OF addon and sharing in openframewors.cc
I've built an OpenFrameworks add-on to do just that:
http://github.com/armadillu/ofxGoogleAnalytics

Map plugin for an MFC application

I want to display a map in a MFC application (Visual Studo 2008 with MFC Feature Pack).
Off the top of my head I have the following requirements:
I have to be able to add my own markers (plain lat/lon positions), preferrably with different colors/icons so one can distinguish between different types of markers.
If the map data is fetched from an online source, it has to be cache-able, i.e. I can pre-load maps for an area at a certain (or several) zoom-level(s) and then switch to "offline mode". Alternatively all map data is installed together with the application.
The standard operations like zoom in/out and pan should be possible for the user.
The user has to be able to select my markers, preferably by dragging a rectangle around them.
Since the whole app is written in C++/MFC I don't want to have to use the .NET runtime for this plugin.
It shouldn't cost a fortune.
I am currently using an ActiveX plugin called "ESRI MapObjects LT2" which can do all that in some way but it's very tedious to implement, the development seems to have stopped around the time when Visual Studio 6 was available and map material is either very basic or very expensive.
I thought about using Google Maps or Google Earth but I think they don't really support being used by non-web based applications.
I found ArcView to be some sort of successor of the plugin I use currently but I don't think I belong to the target audience since the functionality it offers is way more than what I need. Also I didn't find any information on pricing.
I have written an open-source Geocaching app ( it's in c++ ) that renders maps, the source is at:
http://code.google.com/p/gpsturbo/
It uses my own custom rendering but you could rip out the map parsing if you want. It renders map using google tiles ( and caches the tiles for offline use), as well as Garmin format GPS maps, there is also an Openstreetmap format renderer as well.
Reconsider google if you have internet access. You can make an instance of the IE browser appear in a frame within your application. I believe you can use an ActiveX control. Also Google Earth has a way to embed itself into a web page, and possibly an application as well.
Another option is Global Mapper which is not anywhere near as nice as Google Maps or Google Earth.
We used ESRI for a long time before abandoning it due to a lack of performance and lack of support. It was such a big pain to pay $10k for a license, and then be told they need $2k more so that we can actually use the thing. Oh, and then $2k more to add some extra functionality. Even when it didn't work, their support was dismal to lack-luster.
If you are not bound to Google Maps, you could choose OpenStreetMap.
There are couple of known applications for rendering OSM maps:
http://wiki.openstreetmap.org/wiki/Cobra
Kosmos
osmclient (on SourceForge)
First two render map directly, last one uses OpenStreetMap.org tiles.
You can cache as many tiles or data as you want, you are not restricted to do so.