Background:
I've inherited someone else's problem and am trying to get an app up and running. Multiple developers have ditched the project and now its my turn. I'm an iOS developer by trade but I have a few simple android project completed.
The problem app is a native android originally built with API level 7 and is heavily built around google maps api version 1. I don't have access to the original keys so I appear to be forced into upgrading to google maps version 2.
I have already set up a new Activity and am beyond the basic tutorials of getting a functioning map. No problems there, but I'm blocked on items like GeoPoint and don't seem to be able to find much information on its replacement.
My question is this:
Is there a migration path to move from API version 1 to API version 2 or do I have to re-code the whole map component? GeoPoints, custom pins, and overlays included?
The sad answer is that most of the objects of Google Map API V1 are replaced with new Objects in Google Map API V2.
For example instead of using GeoPoints you are going to use Latlng points. Overlays are gone as well and replaced with Polylines and Polygones.
Take a look at this answer I gave here:
Convert Android App that uses maps API V1 to Maps Android API V2
And have a look at this blog post I wrote that will get you started with Google Map API V2 implementation in your app:
Google Map API V2
So as you can understand most of the code should be rewritten to fit Google Map API V2.
Related
I wish to create a maps app which allows people to geotag media to it such as music or photos. The map should also be stylised accordingly to this design here: https://snazzymaps.com/style/151/ultra-light-with-labels What are the steps I need to take to create such an app using the google maps sdk?
Thanks
I think it is not possible or the Google Maps Android API does not support custom styles, The only one that you can change here is the Map types (Normal, Hybrid, Satellite, Terrain). Only the Google Maps JavaScript API can support this style maps.
If you check this thread, you will see here that it is already requested to have a custom style maps in Google Maps Android API. Just check it always if there is an update about here.
My goal is to have a GPS Track displayed in a local Java Application with Google Maps. And I am pretty sure I am not the first one to try this, so there should be a way.
The Problem is that I found the Google Maps Engine API (Deprecated) which is stated as deprecated. But I didn't find any replacement. Only this page, which then links to the deprecated version again.
I also did some search, but all results seem to point to future deprecated API, and also are pretty old.
Can anyone point me a version or tooling that I will be able to still use in 2016? Or does anyone know an alternative to using Google Maps for displaying GPS tracks in a local java app.
Thanks
In case anyone has the same problem:
I used mapsforge https://github.com/mapsforge/mapsforge
JxMaps library provides possibility to add Google Maps to java swing application. Using this library you can draw GPS track either as polyline or set of markers on the map.
i need to implement a desktop application (possibly with Java Swing) in which i can implement maps (not only Google maps but also other services) in two ways: online and offline. Online means the application calls API services by internet, while offline means that i have maps services saved locally and i can request for them also without an internet connection..
Specifically, my application has to draw a polygon on the map (with the API) and do some computations on the background..
Given this, what services can i use to implement at least one way (online or offline) or both? Thanks so much
Initially, google maps only allowed online use of it's API. Any attempt to save maps for use offline was an offence.
I know that the current google maps app (Android / IOS) supports storing maps offline but I don't think this is open to third parties such as yourself. As with everything google, they want your data so they won't let you use the maps offline since they can't see how it's being used.
I've seen many offline mapping applications based on open street map. These maps are open source and free to use as you please (online / offline).
I need to get address from lon lat location. I was trying with geodecoder but it doesn't work (throws Service Not Available). Is there any other solution to that problem?
The geocoder is not guaranteed to exist on all devices. Couple of things to try:
The documentation is not exactly clear, but it seems that if you have the Google add-ons, you should have a geocoder backend implementation. Try linking against the Google APIs for your target API level (see below)
https://stackoverflow.com/a/2255592/483708
In your implementation, prevent erroneous results by explicitly checking for geocoding functionality with Geocoder.isPresent()
http://developer.android.com/reference/android/location/Geocoder.html#isPresent()
If the above points are insufficient, you will need to use the Google Maps Web APIs to perform reverse geocoding via the web:
http://code.google.com/apis/maps/documentation/geocoding/index.html#ReverseGeocoding
Also take a look at the GeoCoderPlus library referenced in this blog post
http://bricolsoftconsulting.com/perfect-geocoding-zoom-part-1/
It uses Google Maps Web APIs, but for 'forward' geocoding. You may be able to use the blog post and the included code as guidance to build your own implementation of reverse geocoding via the web.
It seems to be a bug in the emulator running SDK 2.2. I have had the same problem.
Create a 2.1 or 2.3 emulator and try your code.
Is it possible to render google maps in swing or applet?
I know i can also use NASA World Wind but it seems to much overkill for a simple app.
There is JXMapViewer component in SwingX project. You can write new TileProviderInfo,TileFactory to pull images from Google maps but using JXMapViewer to pull maps from Google was illegal when I used it(2008). Google was usually changing Map URL format so your program can be broken unexpectedly if this is still illegal.
in My last project we have used JXMapViewer and Microsoft Visual Earth instead of Google maps.
You can use JxMaps to render Google Maps in your Swing application. It provides Java API that covers most of Google Maps JavaScript API functionality.