Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Vue demo and iOS typings #331

Merged
merged 1 commit into from
Sep 22, 2019
Merged

Conversation

EddyVerbruggen
Copy link
Contributor

Hi,

Thanks for the great plugin! 🤗

I was playing with it in NativeScript-Vue and noticed there was no Vue demo. Since I figured out how to do it, I though: "why not contribute to the repo?". So here it is.

I also added a script to generate iOS Typings and committed those typings to the repo. They're wired up via src/references.d.ts so you can use them in the iOS source files. I removed the custom TS declarations because of it and fixed 2 minor errors in a delegate.

Cheers,
Eddy

@sebj54
Copy link

sebj54 commented Mar 29, 2019

Hi @EddyVerbruggen, I was playing with NativeScript-Vue too and wanted to run your demo. So I cloned your fork and then:

cd demo-vue
npm install -D
tns run android --bundle

Now I have multiple errors (it seems to be related with Typescript):

ERROR in C:\Users\sebas\projets\nativescript-google-maps-sdk\demo-vue\tsconfig.json
[tsl] ERROR
      TS2688: Cannot find type definition file for 'node'.

ERROR in C:\Users\sebas\projets\nativescript-google-maps-sdk\src\map-view.ts
C:/Users/sebas/projets/nativescript-google-maps-sdk/src/map-view.ts
[tsl] ERROR in C:\Users\sebas\projets\nativescript-google-maps-sdk\src\map-view.ts(1,30)
      TS2307: Cannot find module 'tns-core-modules/application'.

ERROR in C:\Users\sebas\projets\nativescript-google-maps-sdk\src\map-view.ts
C:/Users/sebas/projets/nativescript-google-maps-sdk/src/map-view.ts
[tsl] ERROR in C:\Users\sebas\projets\nativescript-google-maps-sdk\src\map-view.ts(10,23)
      TS2307: Cannot find module 'tns-core-modules/ui/image'.

ERROR in C:\Users\sebas\projets\nativescript-google-maps-sdk\src\map-view.ts
C:/Users/sebas/projets/nativescript-google-maps-sdk/src/map-view.ts
[tsl] ERROR in C:\Users\sebas\projets\nativescript-google-maps-sdk\src\map-view.ts(11,23)
      TS2307: Cannot find module 'tns-core-modules/color'.

ERROR in C:\Users\sebas\projets\nativescript-google-maps-sdk\src\map-view.ts
C:/Users/sebas/projets/nativescript-google-maps-sdk/src/map-view.ts
[tsl] ERROR in C:\Users\sebas\projets\nativescript-google-maps-sdk\src\map-view.ts(12,23)
      TS2307: Cannot find module 'tns-core-modules/ui/core/view'.

ERROR in C:\Users\sebas\projets\nativescript-google-maps-sdk\src\map-view.ts
C:/Users/sebas/projets/nativescript-google-maps-sdk/src/map-view.ts
[tsl] ERROR in C:\Users\sebas\projets\nativescript-google-maps-sdk\src\map-view.ts(13,30)
      TS2307: Cannot find module 'tns-core-modules/image-source'.

ERROR in C:\Users\sebas\projets\nativescript-google-maps-sdk\src\map-view.ts
C:/Users/sebas/projets/nativescript-google-maps-sdk/src/map-view.ts
[tsl] ERROR in C:\Users\sebas\projets\nativescript-google-maps-sdk\src\map-view.ts(15,1)
      TS2354: This syntax requires an imported helper but module 'tslib' cannot be found.

ERROR in C:\Users\sebas\projets\nativescript-google-maps-sdk\src\map-view.ts
C:/Users/sebas/projets/nativescript-google-maps-sdk/src/map-view.ts
[tsl] ERROR in C:\Users\sebas\projets\nativescript-google-maps-sdk\src\map-view.ts(27,15)
      TS2339: Property 'onLoaded' does not exist on type 'MapViewBase'.

ERROR in C:\Users\sebas\projets\nativescript-google-maps-sdk\src\map-view.ts
C:/Users/sebas/projets/nativescript-google-maps-sdk/src/map-view.ts
[tsl] ERROR in C:\Users\sebas\projets\nativescript-google-maps-sdk\src\map-view.ts(36,15)
      TS2339: Property 'onUnloaded' does not exist on type 'MapViewBase'.

ERROR in C:\Users\sebas\projets\nativescript-google-maps-sdk\src\map-view.ts
C:/Users/sebas/projets/nativescript-google-maps-sdk/src/map-view.ts
[tsl] ERROR in C:\Users\sebas\projets\nativescript-google-maps-sdk\src\map-view.ts(45,17)
      TS2339: Property 'nativeView' does not exist on type 'MapView'.

ERROR in C:\Users\sebas\projets\nativescript-google-maps-sdk\src\map-view.ts
C:/Users/sebas/projets/nativescript-google-maps-sdk/src/map-view.ts
[tsl] ERROR in C:\Users\sebas\projets\nativescript-google-maps-sdk\src\map-view.ts(46,18)
      TS2339: Property 'nativeView' does not exist on type 'MapView'.

ERROR in C:\Users\sebas\projets\nativescript-google-maps-sdk\src\map-view.ts
C:/Users/sebas/projets/nativescript-google-maps-sdk/src/map-view.ts
[tsl] ERROR in C:\Users\sebas\projets\nativescript-google-maps-sdk\src\map-view.ts(56,15)
      TS2339: Property 'disposeNativeView' does not exist on type 'MapViewBase'.

ERROR in C:\Users\sebas\projets\nativescript-google-maps-sdk\src\map-view.ts
C:/Users/sebas/projets/nativescript-google-maps-sdk/src/map-view.ts
[tsl] ERROR in C:\Users\sebas\projets\nativescript-google-maps-sdk\src\map-view.ts(60,19)
      TS2339: Property 'nativeView' does not exist on type 'MapView'.

ERROR in C:\Users\sebas\projets\nativescript-google-maps-sdk\src\map-view.ts
C:/Users/sebas/projets/nativescript-google-maps-sdk/src/map-view.ts
[tsl] ERROR in C:\Users\sebas\projets\nativescript-google-maps-sdk\src\map-view.ts(61,14)
      TS2339: Property 'nativeView' does not exist on type 'MapView'.

ERROR in C:\Users\sebas\projets\nativescript-google-maps-sdk\src\map-view.ts
C:/Users/sebas/projets/nativescript-google-maps-sdk/src/map-view.ts
[tsl] ERROR in C:\Users\sebas\projets\nativescript-google-maps-sdk\src\map-view.ts(65,19)
      TS2339: Property 'nativeView' does not exist on type 'MapView'.

ERROR in C:\Users\sebas\projets\nativescript-google-maps-sdk\src\map-view.ts
C:/Users/sebas/projets/nativescript-google-maps-sdk/src/map-view.ts
[tsl] ERROR in C:\Users\sebas\projets\nativescript-google-maps-sdk\src\map-view.ts(66,14)
      TS2339: Property 'nativeView' does not exist on type 'MapView'.

ERROR in C:\Users\sebas\projets\nativescript-google-maps-sdk\src\map-view.ts
C:/Users/sebas/projets/nativescript-google-maps-sdk/src/map-view.ts
[tsl] ERROR in C:\Users\sebas\projets\nativescript-google-maps-sdk\src\map-view.ts(70,19)
      TS2339: Property 'nativeView' does not exist on type 'MapView'.

ERROR in C:\Users\sebas\projets\nativescript-google-maps-sdk\src\map-view.ts
C:/Users/sebas/projets/nativescript-google-maps-sdk/src/map-view.ts
[tsl] ERROR in C:\Users\sebas\projets\nativescript-google-maps-sdk\src\map-view.ts(71,14)
      TS2339: Property 'nativeView' does not exist on type 'MapView'.

ERROR in C:\Users\sebas\projets\nativescript-google-maps-sdk\src\map-view.ts
C:/Users/sebas/projets/nativescript-google-maps-sdk/src/map-view.ts
[tsl] ERROR in C:\Users\sebas\projets\nativescript-google-maps-sdk\src\map-view.ts(75,19)
      TS2339: Property 'nativeView' does not exist on type 'MapView'.

ERROR in C:\Users\sebas\projets\nativescript-google-maps-sdk\src\map-view.ts
C:/Users/sebas/projets/nativescript-google-maps-sdk/src/map-view.ts
[tsl] ERROR in C:\Users\sebas\projets\nativescript-google-maps-sdk\src\map-view.ts(76,14)
      TS2339: Property 'nativeView' does not exist on type 'MapView'.

ERROR in C:\Users\sebas\projets\nativescript-google-maps-sdk\src\map-view.ts
C:/Users/sebas/projets/nativescript-google-maps-sdk/src/map-view.ts
[tsl] ERROR in C:\Users\sebas\projets\nativescript-google-maps-sdk\src\map-view.ts(84,14)
      TS2339: Property 'nativeView' does not exist on type 'MapView'.

ERROR in C:\Users\sebas\projets\nativescript-google-maps-sdk\src\map-view.ts
C:/Users/sebas/projets/nativescript-google-maps-sdk/src/map-view.ts
[tsl] ERROR in C:\Users\sebas\projets\nativescript-google-maps-sdk\src\map-view.ts(85,14)
      TS2339: Property 'nativeView' does not exist on type 'MapView'.

ERROR in C:\Users\sebas\projets\nativescript-google-maps-sdk\src\map-view.ts
C:/Users/sebas/projets/nativescript-google-maps-sdk/src/map-view.ts
[tsl] ERROR in C:\Users\sebas\projets\nativescript-google-maps-sdk\src\map-view.ts(86,14)
      TS2339: Property 'nativeView' does not exist on type 'MapView'.

ERROR in C:\Users\sebas\projets\nativescript-google-maps-sdk\src\map-view.ts
C:/Users/sebas/projets/nativescript-google-maps-sdk/src/map-view.ts
[tsl] ERROR in C:\Users\sebas\projets\nativescript-google-maps-sdk\src\map-view.ts(274,14)
      TS2339: Property 'nativeView' does not exist on type 'MapView'.

ERROR in C:\Users\sebas\projets\nativescript-google-maps-sdk\src\map-view.ts
C:/Users/sebas/projets/nativescript-google-maps-sdk/src/map-view.ts
[tsl] ERROR in C:\Users\sebas\projets\nativescript-google-maps-sdk\src\map-view.ts(276,21)
      TS2339: Property 'nativeView' does not exist on type 'MapView'.

ERROR in C:\Users\sebas\projets\nativescript-google-maps-sdk\src\map-view-common.ts
C:/Users/sebas/projets/nativescript-google-maps-sdk/src/map-view-common.ts
[tsl] ERROR in C:\Users\sebas\projets\nativescript-google-maps-sdk\src\map-view-common.ts(6,54)
      TS2307: Cannot find module 'tns-core-modules/ui/core/view'.

ERROR in C:\Users\sebas\projets\nativescript-google-maps-sdk\src\map-view-common.ts
C:/Users/sebas/projets/nativescript-google-maps-sdk/src/map-view-common.ts
[tsl] ERROR in C:\Users\sebas\projets\nativescript-google-maps-sdk\src\map-view-common.ts(7,23)
      TS2307: Cannot find module 'tns-core-modules/ui/image'.

ERROR in C:\Users\sebas\projets\nativescript-google-maps-sdk\src\map-view-common.ts
C:/Users/sebas/projets/nativescript-google-maps-sdk/src/map-view-common.ts
[tsl] ERROR in C:\Users\sebas\projets\nativescript-google-maps-sdk\src\map-view-common.ts(8,28)
      TS2307: Cannot find module 'tns-core-modules/ui/layouts/layout-base'.

ERROR in C:\Users\sebas\projets\nativescript-google-maps-sdk\src\map-view-common.ts
C:/Users/sebas/projets/nativescript-google-maps-sdk/src/map-view-common.ts
[tsl] ERROR in C:\Users\sebas\projets\nativescript-google-maps-sdk\src\map-view-common.ts(10,26)
      TS2307: Cannot find module 'tns-core-modules/ui/core/properties'.

ERROR in C:\Users\sebas\projets\nativescript-google-maps-sdk\src\map-view-common.ts
C:/Users/sebas/projets/nativescript-google-maps-sdk/src/map-view-common.ts
[tsl] ERROR in C:\Users\sebas\projets\nativescript-google-maps-sdk\src\map-view-common.ts(11,23)
      TS2307: Cannot find module 'tns-core-modules/color'.

ERROR in C:\Users\sebas\projets\nativescript-google-maps-sdk\src\map-view-common.ts
C:/Users/sebas/projets/nativescript-google-maps-sdk/src/map-view-common.ts
[tsl] ERROR in C:\Users\sebas\projets\nativescript-google-maps-sdk\src\map-view-common.ts(12,47)
      TS2307: Cannot find module 'tns-core-modules/ui/builder'.

ERROR in C:\Users\sebas\projets\nativescript-google-maps-sdk\src\map-view-common.ts
C:/Users/sebas/projets/nativescript-google-maps-sdk/src/map-view-common.ts
[tsl] ERROR in C:\Users\sebas\projets\nativescript-google-maps-sdk\src\map-view-common.ts(13,32)
      TS2307: Cannot find module 'tns-core-modules/ui/core/view-base'.

ERROR in C:\Users\sebas\projets\nativescript-google-maps-sdk\src\map-view-common.ts
C:/Users/sebas/projets/nativescript-google-maps-sdk/src/map-view-common.ts
[tsl] ERROR in C:\Users\sebas\projets\nativescript-google-maps-sdk\src\map-view-common.ts(14,36)
      TS2307: Cannot find module 'tns-core-modules/ui/proxy-view-container'.

ERROR in C:\Users\sebas\projets\nativescript-google-maps-sdk\src\map-view-common.ts
C:/Users/sebas/projets/nativescript-google-maps-sdk/src/map-view-common.ts
[tsl] ERROR in C:\Users\sebas\projets\nativescript-google-maps-sdk\src\map-view-common.ts(15,29)
      TS2307: Cannot find module 'tns-core-modules/ui/layouts/stack-layout'.

ERROR in C:\Users\sebas\projets\nativescript-google-maps-sdk\src\map-view-common.ts
C:/Users/sebas/projets/nativescript-google-maps-sdk/src/map-view-common.ts
[tsl] ERROR in C:\Users\sebas\projets\nativescript-google-maps-sdk\src\map-view-common.ts(139,23)
      TS2720: Class 'MapViewBase' incorrectly implements class 'MapView'. Did you mean to extend 'MapView' and inherit its members as a subclass?
  Property 'nativeView' is missing in type 'MapViewBase' but required in type 'MapView'.

ERROR in C:\Users\sebas\projets\nativescript-google-maps-sdk\src\map-view-common.ts
C:/Users/sebas/projets/nativescript-google-maps-sdk/src/map-view-common.ts
[tsl] ERROR in C:\Users\sebas\projets\nativescript-google-maps-sdk\src\map-view-common.ts(223,14)
      TS2339: Property '_addView' does not exist on type 'MapViewBase'.

ERROR in C:\Users\sebas\projets\nativescript-google-maps-sdk\src\map-view-common.ts
C:/Users/sebas/projets/nativescript-google-maps-sdk/src/map-view-common.ts
[tsl] ERROR in C:\Users\sebas\projets\nativescript-google-maps-sdk\src\map-view-common.ts(306,14)
      TS2339: Property 'notify' does not exist on type 'MapViewBase'.

ERROR in C:\Users\sebas\projets\nativescript-google-maps-sdk\src\map-view-common.ts
C:/Users/sebas/projets/nativescript-google-maps-sdk/src/map-view-common.ts
[tsl] ERROR in C:\Users\sebas\projets\nativescript-google-maps-sdk\src\map-view-common.ts(310,39)
      TS2322: Type '{ eventName: string; object: this; marker: Marker; }' is not assignable to type 'MarkerEventData'.
  Object literal may only specify known properties, and 'eventName' does not exist in type 'MarkerEventData'.

ERROR in C:\Users\sebas\projets\nativescript-google-maps-sdk\src\map-view-common.ts
C:/Users/sebas/projets/nativescript-google-maps-sdk/src/map-view-common.ts
[tsl] ERROR in C:\Users\sebas\projets\nativescript-google-maps-sdk\src\map-view-common.ts(311,14)
      TS2339: Property 'notify' does not exist on type 'MapViewBase'.

ERROR in C:\Users\sebas\projets\nativescript-google-maps-sdk\src\map-view-common.ts
C:/Users/sebas/projets/nativescript-google-maps-sdk/src/map-view-common.ts
[tsl] ERROR in C:\Users\sebas\projets\nativescript-google-maps-sdk\src\map-view-common.ts(315,38)
      TS2322: Type '{ eventName: string; object: this; shape: Shape; }' is not assignable to type 'ShapeEventData'.
  Object literal may only specify known properties, and 'eventName' does not exist in type 'ShapeEventData'.

ERROR in C:\Users\sebas\projets\nativescript-google-maps-sdk\src\map-view-common.ts
C:/Users/sebas/projets/nativescript-google-maps-sdk/src/map-view-common.ts
[tsl] ERROR in C:\Users\sebas\projets\nativescript-google-maps-sdk\src\map-view-common.ts(316,14)
      TS2339: Property 'notify' does not exist on type 'MapViewBase'.

ERROR in C:\Users\sebas\projets\nativescript-google-maps-sdk\src\map-view-common.ts
C:/Users/sebas/projets/nativescript-google-maps-sdk/src/map-view-common.ts
[tsl] ERROR in C:\Users\sebas\projets\nativescript-google-maps-sdk\src\map-view-common.ts(340,41)
      TS2322: Type '{ eventName: string; object: this; position: Position; }' is not assignable to type 'PositionEventData'.
  Object literal may only specify known properties, and 'eventName' does not exist in type 'PositionEventData'.

ERROR in C:\Users\sebas\projets\nativescript-google-maps-sdk\src\map-view-common.ts
C:/Users/sebas/projets/nativescript-google-maps-sdk/src/map-view-common.ts
[tsl] ERROR in C:\Users\sebas\projets\nativescript-google-maps-sdk\src\map-view-common.ts(341,14)
      TS2339: Property 'notify' does not exist on type 'MapViewBase'.

ERROR in C:\Users\sebas\projets\nativescript-google-maps-sdk\src\map-view-common.ts
C:/Users/sebas/projets/nativescript-google-maps-sdk/src/map-view-common.ts
[tsl] ERROR in C:\Users\sebas\projets\nativescript-google-maps-sdk\src\map-view-common.ts(345,39)
      TS2322: Type '{ eventName: string; object: this; camera: Camera; }' is not assignable to type 'CameraEventData'.
  Object literal may only specify known properties, and 'eventName' does not exist in type 'CameraEventData'.

ERROR in C:\Users\sebas\projets\nativescript-google-maps-sdk\src\map-view-common.ts
C:/Users/sebas/projets/nativescript-google-maps-sdk/src/map-view-common.ts
[tsl] ERROR in C:\Users\sebas\projets\nativescript-google-maps-sdk\src\map-view-common.ts(346,14)
      TS2339: Property 'notify' does not exist on type 'MapViewBase'.

ERROR in C:\Users\sebas\projets\nativescript-google-maps-sdk\src\map-view-common.ts
C:/Users/sebas/projets/nativescript-google-maps-sdk/src/map-view-common.ts
[tsl] ERROR in C:\Users\sebas\projets\nativescript-google-maps-sdk\src\map-view-common.ts(350,14)
      TS2339: Property 'notify' does not exist on type 'MapViewBase'.

The most interesting is that… it builds anyway 🤷‍♂️
Before that, I tried to build with yarn (I used yarn install and have set yarn as the package manager for tns) and it displayed an exception on the phone.

I didn't know what to do with these logs, so like you, why not contributing? 😊

@randytarampi
Copy link

Any updates on this? I'd love to use this in a nativescript-vue demonstrator at work.

@dapriett dapriett merged commit 0007983 into dapriett:master Sep 22, 2019
@dapriett
Copy link
Owner

Sorry for the delay @EddyVerbruggen - pull request has been merged. Thank you!

@abhayastudios
Copy link
Contributor

abhayastudios commented Oct 1, 2019

Hey @EddyVerbruggen! In this PR you changed the mapViewDidTapMarker method where this return prevents the InfoWindow from showing.

I'm guessing the method returns true before the method notifyMarkerTapped is executed, because the below works (though not sure this is the "correct" way to fix it). WDYT?

setTimeout(() => {
  return true;
},0);

@EddyVerbruggen
Copy link
Contributor Author

Hi @abhayastudios! That's weird.. but if you confirm that behavior then I believe you of course.

dapriett added a commit that referenced this pull request Oct 3, 2019
fix: allow notifying of marker tap event (after #331)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants