A library greatly enhancing the features of the Google Maps external library: Effortless map annotating, gesture support, map callout support, built-in “user tracking” mode, etc.
Polaris is a framework greatly enhancing the Google Maps external framework. It aims to:
Here are some interesting links you can use to discover Polaris:
Polaris is an extension of the Google Maps External Library and hence suffers from a lot of its limitations and bugs (
PolarisMapViewmust be used in a
MapActivity, only one instance of
PolarisMapViewis allowed per
MapActivity, etc.).
While reducing the complexity of the library,
Polarismade the use of
Overlayalmost useless by managing main
Overlays such as
MyLocationOverlayand
ItemizedOverlayinternally. As a consequence, you must never use the
getOverlays()method.
PolarisMapViewprovides replacement methods such as
addOverlay(Overlay),
removeOverlay(Overlay), etc.
Include the PolarisMapView widget in your layout.
In your
onCreatemethod, add/find the PolarisMapView to your layout.
mPolarisMapView = (PolarisMapView) findViewById(R.id.polaris_map_view)
Bind your
MapActivity's
onStartand
onStopmethod to the
PolarisMapViewequivalent.
@Override protected void onStart() { super.onStart(); mPolarisMapView.onStart(); }@Override protected void onStop() { super.onStop(); mPolarisMapView.onStop(); }
The Polaris library is presented as an Android library project. You can include this project by referencing it as a library project in Eclipse or ant.
Using the Google Maps external library requires registering your signing key to Google. When doing so, Google generates an API key you must pass to
MapViewwhen instanciating. For obvious reasons, you must keep these keys private.
Logically, the sample application doesn't include API keys. In order to run the project correctly you must add a
LocalConfig.javafile in the
com.cyrilmottier.android.polarissample.utilpackage containing your own API keys:
package com.cyrilmottier.android.polarissample.util;public final class LocalConfig {
private LocalConfig() { } public static final String GOOGLE_MAPS_API_KEY_RELEASE = "<your_release_key>"; public static final String GOOGLE_MAPS_API_KEY_DEBUG = "<your_debug_key>";
}
Cyril Mottier - [email protected]
Copyright (C) 2012 Cyril Mottier (http://www.cyrilmottier.com)Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.