Comments (12)
I have done something like this
GMSServiceKey.d.ts
declare function GMSServiceKey(): void; export = GMSServiceKey;
GMSServiceKey.js
module.exports = function () { GMSServices.provideAPIKey("YOUR KEY"); };
in app.component.ts
import GMSServiceKey = require('./GMSServiceKey');
and
if (application.ios) { GMSServiceKey(); }
from nativescript-google-maps-sdk.
I can not say for the error but. You just simply create a js file on app folder lik app/app.js and put this code...
"use strict";
var application = require("application");
if(application.ios) {
GMSServices.provideAPIKey("PUT_API_KEY_HERE");
}
application.start({ moduleName: "pages/home/home" });
from nativescript-google-maps-sdk.
I dont think we use the above JS file for Angular 2 version of Nativescript. We require/import nativescript-angular/application
instead of application
. When I use the above code I get the error Cannot find name 'GMSServices'.
from nativescript-google-maps-sdk.
Usually when you can't find GMSServices
, that means the iOS Google Maps pod didn't get installed. Make sure you have cocoapods installed.
from nativescript-google-maps-sdk.
Actually this is first error when build is started, without this line
build succeeds with google map cocoapods installed properly and When app is
run it gives exception too that API key shall be set.
On May 31, 2016 6:32 PM, "dapriett" [email protected] wrote:
Usually when you can't find GMSServices, that means the iOS Google Maps
pod didn't get installed. Make sure you have cocoapods
https://guides.cocoapods.org/using/getting-started.html#getting-started
installed.—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#31 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/ABwtdm1OHeWJ7QdOfcdVu06wYLoDXd9sks5qHDFcgaJpZM4ImcTs
.
from nativescript-google-maps-sdk.
I have installed cocoapods. See below:
$ gem which cocoapods
/Users/deepak/.gem/ruby/2.0.0/gems/cocoapods-1.0.0/lib/cocoapods.rb
from nativescript-google-maps-sdk.
Faced same issue.
Newbie to Angular and Typescript, so not sure where the issue is but as workaround exported GMSServices in JS module and added definition file "d.ts". My 2 cents that there is a issue in typings.
Could you please suggest a better solution. Thanks.
from nativescript-google-maps-sdk.
@ravindrakw Can you share the code snippet that worked for you. Just the bits you where talking about above. Thanks :)
from nativescript-google-maps-sdk.
I also realised we need to register the Element in PascalCase MapView
instead of camelCase mapView
:
registerElement("MapView", () => require("nativescript-google-maps-sdk").MapView);
from nativescript-google-maps-sdk.
Here's a stackoverflow reference, in case anyone else is having issues: http://stackoverflow.com/questions/36443476/wiring-up-google-maps-nativescript-plugin-with-angular-2
from nativescript-google-maps-sdk.
I did the steps ravindrakw mentioned and that fixed my issue. Thank you guys
from nativescript-google-maps-sdk.
Even simpler - in your main.ts file, add
import * as platform from "platform";
declare var GMSServices: any;
// before calling .boostrap
if( platform.isIOS ) {
GMSServices.provideAPIKey("YOUR KEY");
}
from nativescript-google-maps-sdk.
Related Issues (20)
- infoWindow open without a click event HOT 2
- Blank Map with Angular in Suspend/Resume Event HOT 1
- Angular Map not drawing Polylines HOT 6
- shape.loadPoints is not a function?
- Geo political features
- Nativescript 6.0 error maps arr HOT 16
- Conflicts with @triniwiz/nativescript-image-cache-it HOT 1
- Performance Angular? HOT 1
- NS8 infoWindowTemplate is not working HOT 1
- Gesture Handling Cooperative HOT 2
- Gradle 7 requires that compile be changed to implementation
- iOS + M1 - not works HOT 3
- Failed to build plugin nativescript-google-maps-sdk HOT 1
- How to set a pattern in a shape HOT 2
- Version of Google Map API HOT 2
- How to set a tag in shapes or markers HOT 1
- Adding GroundOverlays HOT 1
- Could not find method compile() for arguments [com.google.android.gms:play-services-maps:+] HOT 3
- Uncaught ReferenceError: NativeClass is not defined HOT 3
- Class constructor ActionItem cannot be invoked without 'new' HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nativescript-google-maps-sdk.