Closed zjx closed 8 years ago
Hi, I'm also encountering the same issue. Is there a way i can force Cordova to read the .js file included? Thanks in advance
Running Simulator with Apache Ripple the error is the same: Uncaught ReferenceError: plugin is not defined
Hi guys, please test this plugin WITH VERY SIMPLE CODE at the first.
The VERY SIMPLE CODE means, create a new project, do not install other plugins, do not use any JS frameworks, create simple code like the tutorial. Remember, please don't install the plugin before platforms are added.
vs-log.txt Step by step to reproduce the error:
Get the same uncaught referenceerror
@NestorAcevedo
Thank you for the log, but it seems the log does not contain the records of installing the cordova-plugin-googlemaps
plugin.
Hi @wf9a5m75 Just I run a new project, same steps but moving all javascript from index.html to index.js.
Now I am not getting anything about undefined plugin, now I am getting some like:
missing exec:GoogleMaps.getMap ripple.js:48 GoogleMaps ripple.js:48 getMap ripple.js:41 missing exec:GoogleMaps.isAvailable ripple.js:48 GoogleMaps ripple.js:48 isAvailable
and some additional (I think incoming from Chrome or Ripple): **_GoogleMaps.isAvailable
We seem to be missing some stuff :(
What is kinda cool though you can fill in the textarea to pass a json object to the callback you want to execute_**
Could you share the project?
1> Fetching plugin "cordova-plugin-googlemaps" via npm According of your vs-log-gmaps.txt, you install the plugin from npm.
Please install from the master branch. https://github.com/mapsplugin/cordova-plugin-googlemaps#quick-install
Hi @wf9a5m75
As I said before, I followed the instrtuctions on https://github.com/mapsplugin/cordova-plugin-googlemaps/wiki/Tutorial-for-Windows adding
`
<param name="API_KEY_FOR_IOS" value="YOUR_API_KEY_IS_HERE" />
</vs:plugin>` to config.xml on Visual Studio
The sample project is on https://1drv.ms/f/s!Am9wQZJr33R1k2mauSr3Q1rJIozr
ADD:
I have Cordova CLI version 6.3.1 and I get Error: Registry returned 404 for GET on https://registry.npmjs.org/plugin.google.maps
EDIT
I have used Git Bash and now I could install the plugin on issolated mode (oustide VS): `cordova plugin add cordova-plugin-googlemaps --variable API_KEY_FOR_ANDROID="My API Key" --variable API_KEY_FOR_IOS="My API Key" Found plugin.google.maps is already fetched. Skipped fetching cordova-plugin-googlemaps Installing "plugin.google.maps" for ios Fetching plugin "https://bitbucket.org/nightstomp/cordova-plugin-googlemaps-sdk.git" via git clone Repository "https://bitbucket.org/nightstomp/cordova-plugin-googlemaps-sdk.git" checked out to git ref "master". Installing "com.googlemaps.ios" for ios
Google Maps SDK for iOS : v1.13.0
In order to run this plugin, you need to obtain Google Maps API key for iOS.
Visit https://github.com/mapsplugin/cordova-plugin-googlemaps/wiki/Installation
Check our release notes.
https://github.com/mapsplugin/cordova-plugin-googlemaps/wiki/Release-Notes`
Thank you for sharing your project.
I checked your blank project, and you installed from the npm version, which does not Cordova-ios@4.0. In order to use this plugin, use Cordova-ios@3.9 or install from the master branch. https://github.com/mapsplugin/cordova-plugin-googlemaps#information
At the last, please share your project on github next time instead of One drive. Zip file is un-useful for reviewing.
OK although I shared the full VS project and as basic app the filesize is up to 50MB.
I edited my previous post saying about how did I installed the plugin in my full project.
How to downgrade cordova from 4.0.1 to 3.9 on VS?
I'm not familiar with Visual Studio. Sorry.
How about like this?
<vs:plugin name="https://github.com/mapsplugin/cordova-plugin-googlemaps">
All is right for now in my case, after removing and adding many times the plugin.
What I notice is regarded to Ripple service: missing exec:GoogleMaps.isAvailable ripple.js:48 GoogleMaps ripple.js:48 isAvailable ripple.js:41 missing exec:GoogleMaps.getMap ripple.js:48 GoogleMaps ripple.js:48 getMap
and that is causing the popup with the message _GoogleMaps.isAvailable
We seem to be missing some stuff :(
What is kinda cool though you can fill in the textarea to pass a json object to the callback you want to execute_
I will test in XCode simulator and I will update some results here.
I thinks you(everyone in this thread) use the npm version. However the official document is already changed. So some properties are not available in the npm version, but the master branch version is available.
Please use the master branch version.
$> cordova plugin add https://github.com/mapsplugin/cordova-plugin-googlemaps --variable API_KEY_FOR_ANDROID....
@wf9a5m75 I already did and in my case, as I said before, the new issue is related to Apache Ripple Simulator.
I have never used the Apache Ripple, it means the Apache Ripple is not supported. Please solve your issue by yourself.
Another chance, you can try the v2-beta. Might be solved the issue. https://github.com/mapsplugin/cordova-plugin-googlemaps#version-20-beta
Did you try like this?
window["plugins"].google.maps.Map.getMap()
update
The ionic framework kills this plugin package name for some reason.
In that case, you can use like this window["plugins"].google.maps.Map.getMap
.
I have been fighting this problem also. I have started over from scratch multiple times and followed the guidance to install and use the cordova-plugin-googlemaps with my Monaca app. I swear that I have followed the guidance exactly with the same error repeatedly occurring. I have been using this for reference: https://github.com/mapsplugin/cordova-plugin-googlemaps-doc/blob/master/v2.6.0/hello-world/README.md.
I have installed the plugin and put my API keys into config.xml
The code that throws the error: var map = new plugin.google.maps.Map
The above code is inside a device ready event listener function.
Here is the error: ReferenceError: Can't find variable: plugin
Can someone who has successfully used the cordova-plugin-googlemaps please provide some feedback or any advice. I feel like this plugin doesn't work the way it's documented but I know that is unlikely, so I must be doing something wrong.
plugin.google.maps.Map.getMap()
after the deviceready
event.
Like all Cordova plugins, this plugin only runs in Cordova apps on devices, including simulators.