imhotep / mapkit Goto Github PK
View Code? Open in Web Editor NEWCordova MapKit plugin
Cordova MapKit plugin
trying to run 'cordova build android --release'
MapKit.java:73: exception com.google.android.gms.common.GooglePlayServicesNotAvailableException is never thrown in body of corresponding try statement
[javac] } catch (GooglePlayServicesNotAvailableException e) {
[javac] ^
[javac] 1 error
BUILD FAILED
/Users/alexander/Projects/android_sdk/tools/ant/build.xml:720: The following error occurred while executing this line:
/Users/alexander/Projects/android_sdk/tools/ant/build.xml:734: Compile failed; see the compiler error output for details.
Total time: 4 seconds
Error code 1 for command: ant with args: release,-f,/Users/alexander/Projects/politikontroller/platforms/android/build.xml,-Dout.dir=ant-build,-Dgen.absolute.dir=ant-gen
Error: /Users/alexander/Projects/politikontroller/platforms/android/cordova/build: Command failed with exit code 2
at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/src/superspawn.js:126:23)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:753:16)
at Process.ChildProcess._handle.onexit (child_process.js:820:5)
I have used the sample code as it is. The map opens but the pins will not show
The docs seem rather outdated. It seems to be lacking mentions of:
cordova plugin add com.phonegap.plugins.mapkit
)<script src="js/MapKit.js">
)Also, the examples use plugin.mapKit
when it should be just plain mapKit
.
So, if I cannot use cordova plugin add
with the --variable option, then where would I manually have to place the API Key?
When User taps the map, i need to get the location (latitude and longitude) and add pin over it, I don't find any map click listener to handle this function. Please help ASAP.
Hello,
on Android, when the map is shown the back button close the app instead of fire cordova "backbutton" event.
I'm wondering where the mapview is in the z-index, and if it's possible to have any web elements like divs and spans overlayed on top of the map. I know it is possible to show and hide the map, but I am trying to overlay some dynamic text and animation on top of that view. Anyone know if this is possible?
Hi,
How to get pins from MySQL database in cloud server with PHP?
[LOCAL] - jQuery
var pins = $.get('http://123.456.78.9/pins.php'); // It doesn't work.
[REMOTE] - PHP
echo "[{ lat: -23.561518, lon: -46.656009, title: "A Cool Title, with no Snippet", snippet: "Awesome Snippet", icon: { type: "asset", resource: "http://cache.filehippo.com/img/ex/2171__ChromeNew_icon.png", pinColor: mapKit.iconColors.HUE_VIOLET } }]"; // For example, I am not getting from database.
Thanks!
Is it possible to change mapView height after creation? The problem is when i change device orientation....
Hey guys, while building throws this error:
Compiling app on platform "android" via command "/Users/nicolas/Sites/guider/guider/platforms/android/cordova/build"
[Error: An error occurred while building the android project.Error executing "ant debug -f /Users/nicolas/Sites/guider/guider/platforms/android/build.xml":
BUILD FAILED
/Users/nicolas/adt-bundle-mac/sdk/tools/ant/build.xml:720: The following error occurred while executing this line:
/Users/nicolas/adt-bundle-mac/sdk/tools/ant/build.xml:734: Compile failed; see the compiler error output for details.
Total time: 1 second
my phonegap version
3.2.0-0.16.0
Only with this plugin.
I use
<plugin name="MapKit" value="MapKitView" />
That should be mentioned in readme.md
I know this project has been a little neglected, but it's still the best solution for native maps on iOS for cordova projects.
Would anyone know how to integrate pin clusters into this plugin for iOS? I've installed this pod https://github.com/choefele/CCHMapClusterController but not sure how to get it working with this plugin. Any help would be appreciated.
Looks like there's a restriction on what map pins work:
if ([phAnnotation.pinColor isEqualToString:@"120"])
annView.pinColor = MKPinAnnotationColorGreen;
else if ([phAnnotation.pinColor isEqualToString:@"270"])
annView.pinColor = MKPinAnnotationColorPurple;
else
annView.pinColor = MKPinAnnotationColorRed;
Could we get a functionality to retrieve the current map center?
Hi All,
I've been trying to get the MapKit plugin to work for my simple Appgyver Steroids project, but I keep getting the same error no matter what I try:
ERROR: Plugin 'MapKit' not found, or is not a CDVPlugin. Check your plugin mapping in config.xml.
I have the Mapkit plugin added to my project, using the following command:
cordova plugins add com.phonegap.plugins.mapkit
If I list my cordova plugins I get all of my installed plugins...
com.phonegap.plugins.mapkit 0.9.2 "MapKit"
org.apache.cordova.dialogs 0.2.9 "Notification"
org.apache.cordova.geolocation 0.3.9 "Geolocation"
org.apache.cordova.vibration 0.3.10 "Vibration"
I think the problem is in my config.xml, but I'm not really sure how to map the plugins correctly. This is how my config.xml looks at the moment:
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.appgyver.helloSteroids" version="3.1.8" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>TestApp</name>
<description>
A fresh new Steroids application.
</description>
<author email="[email protected]" href="http://www.appgyver.com/steroids">
AppGyver Steroids Team
</author>
<feature name="Geolocation">
<param name="ios-package" value="CDVLocation" />
</feature>
<feature name="MapKit">
<param name="ios-package" value="CDVLocation" />
</feature>
<access origin="*" />
</widget>
I'm not really sure what to do here and could really use the help!
Hi Anis!
Thanks for your nice map plugin. I have it running already without any problem on iOS, but somehow I'm not getting it to work on Android. I walked through the Android Maps setup guide (https://developers.google.com/maps/documentation/android/start#installing_the_google_maps_android_v2_api), but always get errors during the build that it doesn't find the package "com.google.android.gms.common". Is there somewhere a sample android project I can have a look at, what I've configured wrong?
Thanks for every hint!
Best,
Christoph
Hello, is it possible to change map center after the map is initialized?
I get this error when compiling:
[dx] UNEXPECTED TOP-LEVEL EXCEPTION:
[dx] com.android.dex.DexException: Multiple dex files define Lcom/google/ads/AdRequest$ErrorCode;
[dx] at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:594)
[dx] at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:552)
[dx] at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:533)
[dx] at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:170)
[dx] at com.android.dx.merge.DexMerger.merge(DexMerger.java:188)
[dx] at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:439)
[dx] at com.android.dx.command.dexer.Main.runMonoDex(Main.java:287)
[dx] at com.android.dx.command.dexer.Main.run(Main.java:230)
[dx] at com.android.dx.command.dexer.Main.main(Main.java:199)
[dx] at com.android.dx.command.Main.main(Main.java:103)
[dx]
But I do need google-play-services-admob.jar aswell for my ads... Any ideas to what I can do?
Hello.
I'm just testing your plugin with Cordova 3.1.
I created a sample application by
cordova create Test
cd Test
cordova platforms add android
...
and added some plugins...
cordova plugin add com.phonegap.plugins.mapkit
No if I try to build the application I get the following errors:
[Error: An error occurred while building the android project. Buildfile: /Users/user/Entwicklung/2.0/Test/platforms/android/build.xml
-check-env:
[checkenv] Android SDK Tools Revision 22.2.1
[checkenv] Installed at /Users/user/.adt
-setup:
[echo] Project Name: HelloCordova
[gettype] Project Type: Application
-pre-clean:
clean:
[delete] Deleting directory /Users/user/Entwicklung/2.0/Test/platforms/android/bin
[delete] Deleting directory /Users/user/Entwicklung/2.0/Test/platforms/android/gen
[getlibpath] Library dependencies:
[getlibpath] No Libraries
[subant] No sub-builds to iterate on
BUILD SUCCESSFUL
Total time: 0 seconds
Buildfile: /Users/user/Entwicklung/2.0/Test/platforms/android/build.xml
-set-mode-check:
-set-debug-files:
-check-env:
[checkenv] Android SDK Tools Revision 22.2.1
[checkenv] Installed at /Users/user/.adt
-setup:
[echo] Project Name: HelloCordova
[gettype] Project Type: Application
-set-debug-mode:
-debug-obfuscation-check:
-pre-build:
-build-setup:
[getbuildtools] Using latest Build Tools: 18.1.0
[echo] Resolving Build Target for HelloCordova...
[gettarget] Project Target: Android 4.2.2
[gettarget] API level: 17
[echo] ----------
[echo] Creating output directories if needed...
[mkdir] Created dir: /Users/user/Entwicklung/2.0/Test/platforms/android/bin
[mkdir] Created dir: /Users/user/Entwicklung/2.0/Test/platforms/android/bin/res
[mkdir] Created dir: /Users/user/Entwicklung/2.0/Test/platforms/android/bin/rsObj
[mkdir] Created dir: /Users/user/Entwicklung/2.0/Test/platforms/android/bin/rsLibs
[mkdir] Created dir: /Users/user/Entwicklung/2.0/Test/platforms/android/gen
[mkdir] Created dir: /Users/user/Entwicklung/2.0/Test/platforms/android/bin/classes
[mkdir] Created dir: /Users/user/Entwicklung/2.0/Test/platforms/android/bin/dexedLibs
[echo] ----------
[echo] Resolving Dependencies for HelloCordova...
[dependency] Library dependencies:
[dependency] No Libraries
[dependency]
[dependency] ------------------
[echo] ----------
[echo] Building Libraries with 'debug'...
[subant] No sub-builds to iterate on
-code-gen:
[mergemanifest] Merging AndroidManifest files into one.
[mergemanifest] Manifest merger disabled. Using project manifest only.
[echo] Handling aidl files...
[aidl] No AIDL files to compile.
[echo] ----------
[echo] Handling RenderScript files...
[echo] ----------
[echo] Handling Resources...
[aapt] Generating resource IDs...
[echo] ----------
[echo] Handling BuildConfig class...
[buildconfig] Generating BuildConfig class.
-pre-compile:
-compile:
[javac] Compiling 20 source files to /Users/user/Entwicklung/2.0/Test/platforms/android/bin/classes
[javac] /Users/user/Entwicklung/2.0/Test/platforms/android/src/com/phonegap/plugins/mapkit/MapKit.java:18: package com.google.android.gms.common does not exist
[javac] import com.google.android.gms.common.ConnectionResult;
[javac] ^
[javac] /Users/user/Entwicklung/2.0/Test/platforms/android/src/com/phonegap/plugins/mapkit/MapKit.java:19: package com.google.android.gms.common does not exist
[javac] import com.google.android.gms.common.GooglePlayServicesUtil;
[javac] ^
[javac] /Users/user/Entwicklung/2.0/Test/platforms/android/src/com/phonegap/plugins/mapkit/MapKit.java:20: package com.google.android.gms.common does not exist
[javac] import com.google.android.gms.common.GooglePlayServicesNotAvailableException;
[javac] ^
[javac] /Users/user/Entwicklung/2.0/Test/platforms/android/src/com/phonegap/plugins/mapkit/MapKit.java:21: package com.google.android.gms.maps does not exist
[javac] import com.google.android.gms.maps.CameraUpdateFactory;
[javac] ^
[javac] /Users/user/Entwicklung/2.0/Test/platforms/android/src/com/phonegap/plugins/mapkit/MapKit.java:22: package com.google.android.gms.maps does not exist
[javac] import com.google.android.gms.maps.GoogleMapOptions;
[javac] ^
[javac] /Users/user/Entwicklung/2.0/Test/platforms/android/src/com/phonegap/plugins/mapkit/MapKit.java:23: package com.google.android.gms.maps does not exist
[javac] import com.google.android.gms.maps.MapView;
[javac] ^
[javac] /Users/user/Entwicklung/2.0/Test/platforms/android/src/com/phonegap/plugins/mapkit/MapKit.java:24: package com.google.android.gms.maps does not exist
[javac] import com.google.android.gms.maps.MapsInitializer;
[javac] ^
[javac] /Users/user/Entwicklung/2.0/Test/platforms/android/src/com/phonegap/plugins/mapkit/MapKit.java:25: package com.google.android.gms.maps.model does not exist
[javac] import com.google.android.gms.maps.model.LatLng;
[javac] ^
[javac] /Users/user/Entwicklung/2.0/Test/platforms/android/src/com/phonegap/plugins/mapkit/MapKit.java:26: package com.google.android.gms.maps.model does not exist
[javac] import com.google.android.gms.maps.model.MarkerOptions;
[javac] ^
[javac] /Users/user/Entwicklung/2.0/Test/platforms/android/src/com/phonegap/plugins/mapkit/MapKit.java:27: package com.google.android.gms.maps.model does not exist
[javac] import com.google.android.gms.maps.model.BitmapDescriptor;
[javac] ^
[javac] /Users/user/Entwicklung/2.0/Test/platforms/android/src/com/phonegap/plugins/mapkit/MapKit.java:28: package com.google.android.gms.maps.model does not exist
[javac] import com.google.android.gms.maps.model.BitmapDescriptorFactory;
[javac] ^
[javac] /Users/user/Entwicklung/2.0/Test/platforms/android/src/com/phonegap/plugins/mapkit/MapKit.java:34: cannot find symbol
[javac] symbol : class MapView
[javac] location: class com.phonegap.plugins.mapkit.MapKit
[javac] protected MapView mapView;
[javac] ^
[javac] /Users/user/Entwicklung/2.0/Test/platforms/android/src/com/phonegap/plugins/mapkit/MapKit.java:198: cannot find symbol
[javac] symbol : class BitmapDescriptor
[javac] location: class com.phonegap.plugins.mapkit.MapKit
[javac] private BitmapDescriptor getBitmapDescriptor( final JSONObject iconOption ) {
[javac] ^
[javac] /Users/user/Entwicklung/2.0/Test/platforms/android/src/com/phonegap/plugins/mapkit/MapKit.java:61: cannot find symbol
[javac] symbol: variable GooglePlayServicesUtil
[javac] final int resultCode = GooglePlayServicesUtil.isGooglePlayServicesAvailable(cordova.getActivity());
[javac] ^
[javac] /Users/user/Entwicklung/2.0/Test/platforms/android/src/com/phonegap/plugins/mapkit/MapKit.java:62: cannot find symbol
[javac] symbol: variable ConnectionResult
[javac] if (resultCode == ConnectionResult.SUCCESS) {
[javac] ^
[javac] /Users/user/Entwicklung/2.0/Test/platforms/android/src/com/phonegap/plugins/mapkit/MapKit.java:63: cannot find symbol
[javac] symbol: class MapView
[javac] mapView = new MapView(cordova.getActivity(),
[javac] ^
[javac] /Users/user/Entwicklung/2.0/Test/platforms/android/src/com/phonegap/plugins/mapkit/MapKit.java:64: cannot find symbol
[javac] symbol: class GoogleMapOptions
[javac] new GoogleMapOptions());
[javac] ^
[javac] /Users/user/Entwicklung/2.0/Test/platforms/android/src/com/phonegap/plugins/mapkit/MapKit.java:72: cannot find symbol
[javac] symbol: variable MapsInitializer
[javac] MapsInitializer.initialize(cordova.getActivity());
[javac] ^
[javac] /Users/user/Entwicklung/2.0/Test/platforms/android/src/com/phonegap/plugins/mapkit/MapKit.java:73: cannot find symbol
[javac] symbol: class GooglePlayServicesNotAvailableException
[javac] } catch (GooglePlayServicesNotAvailableException e) {
[javac] ^
[javac] /Users/user/Entwicklung/2.0/Test/platforms/android/src/com/phonegap/plugins/mapkit/MapKit.java:97: cannot find symbol
[javac] symbol: class LatLng
[javac] CameraUpdateFactory.newLatLngZoom(new LatLng(
[javac] ^
[javac] /Users/user/Entwicklung/2.0/Test/platforms/android/src/com/phonegap/plugins/mapkit/MapKit.java:97: cannot find symbol
[javac] symbol: variable CameraUpdateFactory
[javac] CameraUpdateFactory.newLatLngZoom(new LatLng(
[javac] ^
[javac] /Users/user/Entwicklung/2.0/Test/platforms/android/src/com/phonegap/plugins/mapkit/MapKit.java:101: cannot find symbol
[javac] symbol: variable ConnectionResult
[javac] } else if (resultCode == ConnectionResult.SERVICE_MISSING ||
[javac] ^
[javac] /Users/user/Entwicklung/2.0/Test/platforms/android/src/com/phonegap/plugins/mapkit/MapKit.java:102: cannot find symbol
[javac] symbol: variable ConnectionResult
[javac] resultCode == ConnectionResult.SERVICE_VERSION_UPDATE_REQUIRED ||
[javac] ^
[javac] /Users/user/Entwicklung/2.0/Test/platforms/android/src/com/phonegap/plugins/mapkit/MapKit.java:103: cannot find symbol
[javac] symbol: variable ConnectionResult
[javac] resultCode == ConnectionResult.SERVICE_DISABLED) {
[javac] ^
[javac] /Users/user/Entwicklung/2.0/Test/platforms/android/src/com/phonegap/plugins/mapkit/MapKit.java:104: cannot find symbol
[javac] symbol: variable GooglePlayServicesUtil
[javac] Dialog dialog = GooglePlayServicesUtil.getErrorDialog(resultCode, cordova.getActivity(), 1,
[javac] ^
[javac] /Users/user/Entwicklung/2.0/Test/platforms/android/src/com/phonegap/plugins/mapkit/MapKit.java:158: cannot find symbol
[javac] symbol: class MarkerOptions
[javac] MarkerOptions mOptions = new MarkerOptions();
[javac] ^
[javac] /Users/user/Entwicklung/2.0/Test/platforms/android/src/com/phonegap/plugins/mapkit/MapKit.java:158: cannot find symbol
[javac] symbol: class MarkerOptions
[javac] MarkerOptions mOptions = new MarkerOptions();
[javac] ^
[javac] /Users/user/Entwicklung/2.0/Test/platforms/android/src/com/phonegap/plugins/mapkit/MapKit.java:160: cannot find symbol
[javac] symbol: class LatLng
[javac] mOptions.position(new LatLng(latitude,
[javac] ^
[javac] /Users/user/Entwicklung/2.0/Test/platforms/android/src/com/phonegap/plugins/mapkit/MapKit.java:169: cannot find symbol
[javac] symbol: class BitmapDescriptor
[javac] BitmapDescriptor bDesc = getBitmapDescriptor(options);
[javac] ^
[javac] /Users/user/Entwicklung/2.0/Test/platforms/android/src/com/phonegap/plugins/mapkit/MapKit.java:208: cannot find symbol
[javac] symbol : variable BitmapDescriptorFactory
[javac] location: class com.phonegap.plugins.mapkit.MapKit
[javac] return BitmapDescriptorFactory.fromAsset(resource);
[javac] ^
[javac] /Users/user/Entwicklung/2.0/Test/platforms/android/src/com/phonegap/plugins/mapkit/MapKit.java:213: cannot find symbol
[javac] symbol : variable BitmapDescriptorFactory
[javac] location: class com.phonegap.plugins.mapkit.MapKit
[javac] return BitmapDescriptorFactory.defaultMarker(Float.parseFloat(o.toString()));
[javac] ^
[javac] 31 errors
BUILD FAILED
/Users/user/.adt/tools/ant/build.xml:720: The following error occurred while executing this line:
/Users/user/.adt/tools/ant/build.xml:734: Compile failed; see the compiler error output for details.
Total time: 2 seconds
ERROR: Failed to build android project.
Buildfile: /Users/user/Entwicklung/2.0/Test/platforms/android/build.xml
-set-mode-check:
-set-debug-files:
-check-env:
[checkenv] Android SDK Tools Revision 22.2.1
[checkenv] Installed at /Users/user/.adt
-setup:
[echo] Project Name: HelloCordova
[gettype] Project Type: Application
-set-debug-mode:
-debug-obfuscation-check:
-pre-build:
-build-setup:
[getbuildtools] Using latest Build Tools: 18.1.0
[echo] Resolving Build Target for HelloCordova...
[gettarget] Project Target: Android 4.2.2
[gettarget] API level: 17
[echo] ----------
[echo] Creating output directories if needed...
[mkdir] Created dir: /Users/user/Entwicklung/2.0/Test/platforms/android/bin
[mkdir] Created dir: /Users/user/Entwicklung/2.0/Test/platforms/android/bin/res
[mkdir] Created dir: /Users/user/Entwicklung/2.0/Test/platforms/android/bin/rsObj
[mkdir] Created dir: /Users/user/Entwicklung/2.0/Test/platforms/android/bin/rsLibs
[mkdir] Created dir: /Users/user/Entwicklung/2.0/Test/platforms/android/gen
[mkdir] Created dir: /Users/user/Entwicklung/2.0/Test/platforms/android/bin/classes
[mkdir] Created dir: /Users/user/Entwicklung/2.0/Test/platforms/android/bin/dexedLibs
[echo] ----------
[echo] Resolving Dependencies for HelloCordova...
[dependency] Library dependencies:
[dependency] No Libraries
[dependency]
[dependency] ------------------
[echo] ----------
[echo] Building Libraries with 'debug'...
[subant] No sub-builds to iterate on
-code-gen:
[mergemanifest] Merging AndroidManifest files into one.
[mergemanifest] Manifest merger disabled. Using project manifest only.
[echo] Handling aidl files...
[aidl] No AIDL files to compile.
[echo] ----------
[echo] Handling RenderScript files...
[echo] ----------
[echo] Handling Resources...
[aapt] Generating resource IDs...
[echo] ----------
[echo] Handling BuildConfig class...
[buildconfig] Generating BuildConfig class.
-pre-compile:
-compile:
[javac] Compiling 20 source files to /Users/user/Entwicklung/2.0/Test/platforms/android/bin/classes
[javac] /Users/user/Entwicklung/2.0/Test/platforms/android/src/com/phonegap/plugins/mapkit/MapKit.java:18: package com.google.android.gms.common does not exist
[javac] import com.google.android.gms.common.ConnectionResult;
[javac] ^
[javac] /Users/user/Entwicklung/2.0/Test/platforms/android/src/com/phonegap/plugins/mapkit/MapKit.java:19: package com.google.android.gms.common does not exist
[javac] import com.google.android.gms.common.GooglePlayServicesUtil;
[javac] ^
[javac] /Users/user/Entwicklung/2.0/Test/platforms/android/src/com/phonegap/plugins/mapkit/MapKit.java:20: package com.google.android.gms.common does not exist
[javac] import com.google.android.gms.common.GooglePlayServicesNotAvailableException;
[javac] ^
[javac] /Users/user/Entwicklung/2.0/Test/platforms/android/src/com/phonegap/plugins/mapkit/MapKit.java:21: package com.google.android.gms.maps does not exist
[javac] import com.google.android.gms.maps.CameraUpdateFactory;
[javac] ^
[javac] /Users/user/Entwicklung/2.0/Test/platforms/android/src/com/phonegap/plugins/mapkit/MapKit.java:22: package com.google.android.gms.maps does not exist
[javac] import com.google.android.gms.maps.GoogleMapOptions;
[javac] ^
[javac] /Users/user/Entwicklung/2.0/Test/platforms/android/src/com/phonegap/plugins/mapkit/MapKit.java:23: package com.google.android.gms.maps does not exist
[javac] import com.google.android.gms.maps.MapView;
[javac] ^
[javac] /Users/user/Entwicklung/2.0/Test/platforms/android/src/com/phonegap/plugins/mapkit/MapKit.java:24: package com.google.android.gms.maps does not exist
[javac] import com.google.android.gms.maps.MapsInitializer;
[javac] ^
[javac] /Users/user/Entwicklung/2.0/Test/platforms/android/src/com/phonegap/plugins/mapkit/MapKit.java:25: package com.google.android.gms.maps.model does not exist
[javac] import com.google.android.gms.maps.model.LatLng;
[javac] ^
[javac] /Users/user/Entwicklung/2.0/Test/platforms/android/src/com/phonegap/plugins/mapkit/MapKit.java:26: package com.google.android.gms.maps.model does not exist
[javac] import com.google.android.gms.maps.model.MarkerOptions;
[javac] ^
[javac] /Users/user/Entwicklung/2.0/Test/platforms/android/src/com/phonegap/plugins/mapkit/MapKit.java:27: package com.google.android.gms.maps.model does not exist
[javac] import com.google.android.gms.maps.model.BitmapDescriptor;
[javac] ^
[javac] /Users/user/Entwicklung/2.0/Test/platforms/android/src/com/phonegap/plugins/mapkit/MapKit.java:28: package com.google.android.gms.maps.model does not exist
[javac] import com.google.android.gms.maps.model.BitmapDescriptorFactory;
[javac] ^
[javac] /Users/user/Entwicklung/2.0/Test/platforms/android/src/com/phonegap/plugins/mapkit/MapKit.java:34: cannot find symbol
[javac] symbol : class MapView
[javac] location: class com.phonegap.plugins.mapkit.MapKit
[javac] protected MapView mapView;
[javac] ^
[javac] /Users/user/Entwicklung/2.0/Test/platforms/android/src/com/phonegap/plugins/mapkit/MapKit.java:198: cannot find symbol
[javac] symbol : class BitmapDescriptor
[javac] location: class com.phonegap.plugins.mapkit.MapKit
[javac] private BitmapDescriptor getBitmapDescriptor( final JSONObject iconOption ) {
[javac] ^
[javac] /Users/user/Entwicklung/2.0/Test/platforms/android/src/com/phonegap/plugins/mapkit/MapKit.java:61: cannot find symbol
[javac] symbol: variable GooglePlayServicesUtil
[javac] final int resultCode = GooglePlayServicesUtil.isGooglePlayServicesAvailable(cordova.getActivity());
[javac] ^
[javac] /Users/user/Entwicklung/2.0/Test/platforms/android/src/com/phonegap/plugins/mapkit/MapKit.java:62: cannot find symbol
[javac] symbol: variable ConnectionResult
[javac] if (resultCode == ConnectionResult.SUCCESS) {
[javac] ^
[javac] /Users/user/Entwicklung/2.0/Test/platforms/android/src/com/phonegap/plugins/mapkit/MapKit.java:63: cannot find symbol
[javac] symbol: class MapView
[javac] mapView = new MapView(cordova.getActivity(),
[javac] ^
[javac] /Users/user/Entwicklung/2.0/Test/platforms/android/src/com/phonegap/plugins/mapkit/MapKit.java:64: cannot find symbol
[javac] symbol: class GoogleMapOptions
[javac] new GoogleMapOptions());
[javac] ^
[javac] /Users/user/Entwicklung/2.0/Test/platforms/android/src/com/phonegap/plugins/mapkit/MapKit.java:72: cannot find symbol
[javac] symbol: variable MapsInitializer
[javac] MapsInitializer.initialize(cordova.getActivity());
[javac] ^
[javac] /Users/user/Entwicklung/2.0/Test/platforms/android/src/com/phonegap/plugins/mapkit/MapKit.java:73: cannot find symbol
[javac] symbol: class GooglePlayServicesNotAvailableException
[javac] } catch (GooglePlayServicesNotAvailableException e) {
[javac] ^
[javac] /Users/user/Entwicklung/2.0/Test/platforms/android/src/com/phonegap/plugins/mapkit/MapKit.java:97: cannot find symbol
[javac] symbol: class LatLng
[javac] CameraUpdateFactory.newLatLngZoom(new LatLng(
[javac] ^
[javac] /Users/user/Entwicklung/2.0/Test/platforms/android/src/com/phonegap/plugins/mapkit/MapKit.java:97: cannot find symbol
[javac] symbol: variable CameraUpdateFactory
[javac] CameraUpdateFactory.newLatLngZoom(new LatLng(
[javac] ^
[javac] /Users/user/Entwicklung/2.0/Test/platforms/android/src/com/phonegap/plugins/mapkit/MapKit.java:101: cannot find symbol
[javac] symbol: variable ConnectionResult
[javac] } else if (resultCode == ConnectionResult.SERVICE_MISSING ||
[javac] ^
[javac] /Users/user/Entwicklung/2.0/Test/platforms/android/src/com/phonegap/plugins/mapkit/MapKit.java:102: cannot find symbol
[javac] symbol: variable ConnectionResult
[javac] resultCode == ConnectionResult.SERVICE_VERSION_UPDATE_REQUIRED ||
[javac] ^
[javac] /Users/user/Entwicklung/2.0/Test/platforms/android/src/com/phonegap/plugins/mapkit/MapKit.java:103: cannot find symbol
[javac] symbol: variable ConnectionResult
[javac] resultCode == ConnectionResult.SERVICE_DISABLED) {
[javac] ^
[javac] /Users/user/Entwicklung/2.0/Test/platforms/android/src/com/phonegap/plugins/mapkit/MapKit.java:104: cannot find symbol
[javac] symbol: variable GooglePlayServicesUtil
[javac] Dialog dialog = GooglePlayServicesUtil.getErrorDialog(resultCode, cordova.getActivity(), 1,
[javac] ^
[javac] /Users/user/Entwicklung/2.0/Test/platforms/android/src/com/phonegap/plugins/mapkit/MapKit.java:158: cannot find symbol
[javac] symbol: class MarkerOptions
[javac] MarkerOptions mOptions = new MarkerOptions();
[javac] ^
[javac] /Users/user/Entwicklung/2.0/Test/platforms/android/src/com/phonegap/plugins/mapkit/MapKit.java:158: cannot find symbol
[javac] symbol: class MarkerOptions
[javac] MarkerOptions mOptions = new MarkerOptions();
[javac] ^
[javac] /Users/user/Entwicklung/2.0/Test/platforms/android/src/com/phonegap/plugins/mapkit/MapKit.java:160: cannot find symbol
[javac] symbol: class LatLng
[javac] mOptions.position(new LatLng(latitude,
[javac] ^
[javac] /Users/user/Entwicklung/2.0/Test/platforms/android/src/com/phonegap/plugins/mapkit/MapKit.java:169: cannot find symbol
[javac] symbol: class BitmapDescriptor
[javac] BitmapDescriptor bDesc = getBitmapDescriptor(options);
[javac] ^
[javac] /Users/user/Entwicklung/2.0/Test/platforms/android/src/com/phonegap/plugins/mapkit/MapKit.java:208: cannot find symbol
[javac] symbol : variable BitmapDescriptorFactory
[javac] location: class com.phonegap.plugins.mapkit.MapKit
[javac] return BitmapDescriptorFactory.fromAsset(resource);
[javac] ^
[javac] /Users/user/Entwicklung/2.0/Test/platforms/android/src/com/phonegap/plugins/mapkit/MapKit.java:213: cannot find symbol
[javac] symbol : variable BitmapDescriptorFactory
[javac] location: class com.phonegap.plugins.mapkit.MapKit
[javac] return BitmapDescriptorFactory.defaultMarker(Float.parseFloat(o.toString()));
[javac] ^
[javac] 31 errors
BUILD FAILED
/Users/user/.adt/tools/ant/build.xml:720: The following error occurred while executing this line:
/Users/user/.adt/tools/ant/build.xml:734: Compile failed; see the compiler error output for details.
Total time: 2 seconds
]
I installed the latest Android versions and the Google Play services.
Can anyone help setting up this project?
Thanks!
Is there a method who search pois near my position by API?
/Users/alexander/Projects/android_sdk/tools/ant/build.xml:577: /Users/alexander/Projects/android_sdk/extras/google/google_play_services/libproject/google-play-services_lib/ resolve to a path with no project.properties file for project /Users/alexander/Projects/test_app/platforms/android
What do you mean by that? YOUR_ANDROID_TARGET
I am newbie, sorry in the case the issue is insignificant:
I followed all the steps in the readme and installed the plugin with plugman. Further followed all the steps descriped in the console.
Do I need to copy mapkit.js in the www/js folder or declare it somewhere? i cannot find it in the builded app.
Building android with cordova (3.3.1-0.1.2) cli
Thank you all in advance
I tried many ways but I could not embed Mapkit into DOM. Please assist me.
Hi, am still trying to get this working on iOS. When installing with plugman i was just returning "error". So i tried using the 3.0 CLI as suggested in a different thread, which seems to install the MapKit plugin ok, but i cant execute any of the MapKit js code from the app. Here are my steps exactly from step dot. please can you let me know what i am doing wrong.
npm install -g cordova
phonegap create hello com.example.hello HelloWorld
cd hello
phonegap build ios
phonegap local plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-console.git
phonegap local plugin add https://github.com/imhotep/MapKit.git
app.showMap();
from inside onDeviceReady
phonegap build ios
so, the app launches but don't see the map. even when i remove the sample code and just try and console.log(MapKit);
i get nothing returned.
it doesnt look like the MapKit.js code is getting compiled into cordova_plugins.js on build. is it meant to, or should i reference the MapKit.js file in my html? i see that upon build it creates the file platforms/ios/www/js/MapKit.js
, but when i just try to reference that in the html, the logger in xcode gives me this
2013-09-13 22:28:54.190 HelloWorld[6416:c07] -[__NSCFArray objectForKey:]: unrecognized selector sent to instance 0xaa699b0
2013-09-13 22:28:54.191 HelloWorld[6416:c07] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFArray objectForKey:]: unrecognized selector sent to instance 0xaa699b0'
*** First throw call stack:
(0x103012 0x2978e7e 0x18e4bd 0xf2bbc 0xf294e 0x3b05b 0x196c3 0x18efb 0x18a6d 0x18bf6 0x18b23 0x298c6b0 0x149e765 0x86f3f 0x8696f 0xa9734 0xa8f44 0xa8e1b 0x37a97e3 0x37a9668 0x33effc 0x1f72c 0x1f68d 0x1)
libc++abi.dylib: terminate called throwing an exception
(lldb)
is there perhaps anything i need to put into the global config.xml to make it work?
thanks so much for your help :)
Is it possible to put HTML elements on top of the map?
I have a problem with phonegap 3.0 ...
-> exec() call to unknow plugin : MapKit
will be there a stable version for PhoneGap 3.0?
for example:
this
"import org.apache.cordova.io.CordovaWebView"
was changed in this
"import org.apache.cordova.CordovaWebView"
I have follow the steps on #18. I have install API19 and all extras, included Google Play Services. When I try to run it for android, I get this issue:
-pre-compile:
[echo] Set jars path to: C:\cordova\prueba\platforms\android\CordovaLib\ant-build\classes.jar;C:\adt-bundle\sdk\extras\google\google_play_services\libproject\google-play-services_lib\ant-build\classes.jar;C:\adt-bundle\sdk\extras\google\google_play_services\libproject\google-play-services_lib\libs\google-play-services.jar
-compile:
[javac] Compiling 6 source files to c:\cordova\prueba\platforms\android\ant-build\classes
[javac] c:\cordova\prueba\platforms\android\src\com\phonegap\plugins\mapkit\MapKit.java:73: error: exception GooglePlayServicesNotAvailableException is never thrown in body of corresponding try statement
[javac] } catch (GooglePlayServicesNotAvailableException e) {
[javac] ^
[javac] 1 error
Any idea? Thanks!
To get the pin label 'more' button onclick functionality working, add a few lines to the createViewWithOptions method in MapKit.m:
if ([options objectForKey:@"buttonCallback"])
{
self.buttonCallback=[[options objectForKey:@"buttonCallback"] description];
}
The rest of the required code is already present in MapKit.m.
Then, in JavaScript add the name of the callback method to the options object:
this.options = {
height: 460,
diameter: 1000,
atBottom: true,
lat: 49.281468,
lon: -123.104446,
buttonCallback: "myCallback"
};
The callback method receives the index of the selected pin.
Not really an issue, just a note. Perhaps it helps someone.
android:value="@integer/google_play_services_version" this parameter gives error when compiling, how can I solve it?
is possible redirect in the other page when i click on the Pins in the maps?
Sometimes the app crashes when doing mapHide()
W/dalvikvm( 6250): threadid=1: thread exiting with uncaught exception (group=0x4184cda0)
E/AndroidRuntime( 6250): FATAL EXCEPTION: main
E/AndroidRuntime( 6250): Process: com.superapp.SuperApp, PID: 6250
E/AndroidRuntime( 6250): java.lang.NullPointerException
E/AndroidRuntime( 6250): at com.phonegap.plugins.mapkit.MapKit$4.run(MapKit.java:369)
E/AndroidRuntime( 6250): at android.os.Handler.handleCallback(Handler.java:733)
E/AndroidRuntime( 6250): at android.os.Handler.dispatchMessage(Handler.java:95)
E/AndroidRuntime( 6250): at android.os.Looper.loop(Looper.java:157)
E/AndroidRuntime( 6250): at android.app.ActivityThread.main(ActivityThread.java:5356)
E/AndroidRuntime( 6250): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 6250): at java.lang.reflect.Method.invoke(Method.java:515)
E/AndroidRuntime( 6250): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1265)
E/AndroidRuntime( 6250): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1081)
E/AndroidRuntime( 6250): at dalvik.system.NativeStart.main(Native Method)
Hi! Nice work!
Referring to the readme "Currently only works/tested on Android. iOS is currently outdated and DOES NOT WORK."
Does this mean that it does not work for Cordova 2.6.0 but with older Cordova? Or doesn't work at all?
Have you tried https://github.com/bhurlow/cordova-mapkit ?
I get this when I try to showMap:
E/AndroidRuntime( 568): java.lang.NullPointerException: CameraUpdateFactory is not initialized
I've got the map embedded on iOS but cannot change the default location.
I tried changing (in MapKit.js)
var MapKit = function() {
this.options = {
height: 260,
diameter: 1000,
atBottom: true,
lat: 33.281468,
lon: -71.104446
};
the lat and lon to different values but the map always opens to the same location.
What am I doing wrong here?
Cheers,
How can I display the tooltip opened over the pin when I create it? There is any way? Thanks
If I call
mapKit.addMapPins([[51.49,7.00]], function() {
console.log('adMapPins success');
},
function() { console.log('error'); });
I get an error at the console saying:
W/System.err(15271): org.json.JSONException: Value [51.49,7] at 0 of type org.json.JSONArray cannot be converted to JSONObject
W/System.err(15271): at org.json.JSON.typeMismatch(JSON.java:100)
W/System.err(15271): at org.json.JSONArray.getJSONObject(JSONArray.java:484)
W/System.err(15271): at com.phonegap.plugins.mapkit.MapKit$3.run(MapKit.java:154)
W/System.err(15271): at android.os.Handler.handleCallback(Handler.java:730)
W/System.err(15271): at android.os.Handler.dispatchMessage(Handler.java:92)
W/System.err(15271): at android.os.Looper.loop(Looper.java:137)
W/System.err(15271): at android.app.ActivityThread.main(ActivityThread.java:5103)
W/System.err(15271): at java.lang.reflect.Method.invokeNative(Native Method)
W/System.err(15271): at java.lang.reflect.Method.invoke(Method.java:525)
W/System.err(15271): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
W/System.err(15271): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
W/System.err(15271): at dalvik.system.NativeStart.main(Native Method)
E/MapKitPlugin(15271): An error occurred while reading pins
It's possible set custom icons on ios version??
var pins = [{
lat: 49.27503,
lon: -123.12138,
title: "A Cool Title, with no Snippet",
icon: {
type: "asset",
resource: "www/img/logo.png", //an image in the asset directory
pinColor: mapKit.iconColors.HUE_VIOLET //iOS only
}
}];
"logo.png" isn't loaded...
Thanksss
Hi there,
I was just wondering if I can overlay Buttons in Android or iOS without having to program on the native side.
The second question is: Can I use your plugin in famo.us (http://famo.us)?
Best regards
Im having issues with MapKit on android. It compiles ok after doing the suggested things in the readme. The problem I am having is that it fails - not running the success or the fail callbacks.
I get nothing no positive or negative feedback. Or any map. Also its fine on ios.
when i run the program, thread warning.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.