dapriett / nativescript-google-maps-sdk

Cross Platform Google Maps SDK for Nativescript
MIT License
244 stars 164 forks source link

Support for NS7 #440

Closed kefahB closed 3 years ago

kefahB commented 3 years ago

Hi @dapriett,

I've updated this plugin for NS7 core, tested on IOS (iPhone 8, XR on IOS 12) and (iPhone 6, 11 Pro on IOS 14.0) and android as well.

Still there is some issue if we declare infoWindowTemplates template with this error :

> Module 'Template' not found for element 'Template'.
> instanceType is not a constructor
at
ScopeError(file: node_modules/@nativescript/core/utils/debug.js:51:0)
at SourceError(file: node_modules/@nativescript/core/utils/debug.js:58:0)
at (file: node_modules/@nativescript/core/ui/builder/index.js:228:0)
at (file: node_modules/@nativescript/core/ui/builder/index.js:207:0)
at (file: node_modules/@nativescript/core/xml/index.js:412:0)
at push.../node_modules/@nativescript/core/js-libs/easysax/easysax.js.EasySAXParser.parse(file: node_modules/@nativescript/core/js-libs/easysax/easysax.js:751:0)
at parse(file: node_modules/@nativescript/core/xml/index.js:455:0)
at parse(file: node_modules/@nativescript/core/ui/builder/index.js:213:0)
at parseInternal(file: node_modules/@nativescript/core/ui/builder/index.js:181:0)
at loadInternal(file: node_modules/@nativescript/core/ui/builder/index.js:94:0)
at createViewFromEntry(file: node_modules/@nativescript/core/ui/builder/index.js:36:0)
at createRootView(file: node_modules/@nativescript/core/application/index.ios.js:312:30)
at setWindowContent(file: node_modules/@nativescript/core/application/index.ios.js:253:0)
at notifyAppStarted(file: node_modules/@nativescript/core/application/index.ios.js:165:0)
at didFinishLaunchingWithOptions(file: node_modules/@nativescript/core/application/index.ios.js:149:0)
at push.../node_modules/@nativescript/<…>

Also I've tried to activate the button MyLocation it work but we must find a way (I dont now how) to implement 2 delegates on MapView see here

Thanks to @funder7 for his great job.

Please give it a try

Burgov commented 3 years ago

@kefahB I tried to run your branch, but when I do npm run demo.ios I get the error

Error: Cannot find module '/Users/bart/workspace/snappcar/nativescript-google-maps-sdk/demo/node_modules/webpack/bin/webpack.js'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
    at Function.Module._load (internal/modules/cjs/loader.js:725:27)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
    at internal/main/run_main_module.js:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

and when I try to include your branch directly in my project, I get tons of errors like these:

../../../nativescript-google-maps-sdk/src/map-view.ios.ts:1074:9 - error TS2611: 'radius' is defined as a property in class 'CircleBase', but is overridden here in 'Circle' as an accessor.

1074     get radius() {
             ~~~~~~
../../../nativescript-google-maps-sdk/src/map-view.ios.ts:1082:9 - error TS2611: 'strokeWidth' is defined as a property in class 'CircleBase', but is overridden here in 'Circle' as an accessor.

1082     get strokeWidth() {
             ~~~~~~~~~~~
../../../nativescript-google-maps-sdk/src/map-view.ios.ts:1090:9 - error TS2611: 'strokeColor' is defined as a property in class 'CircleBase', but is overridden here in 'Circle' as an accessor.

1090     get strokeColor() {
             ~~~~~~~~~~~
../../../nativescript-google-maps-sdk/src/map-view.ios.ts:1099:9 - error TS2611: 'fillColor' is defined as a property in class 'CircleBase', but is overridden here in 'Circle' as an accessor.

1099     get fillColor() {
             ~~~~~~~~~

do you not get these errors?

Burgov commented 3 years ago

ok it's running now, I added ts-ignore to the top of that file. the errors i ran into are due to a breaking change in TS4, which is the default NG10 version, so we should fix that.

Now i do see the map view, but it's gray and only shows the google logo. Investigating what may be causing that

Burgov commented 3 years ago

Ok so all those errors happen when running against TS4, but your branch still references TS3.9, so it's OK.

The blank iOS map also happens on the original master branch, so again, no regression but something we'll have to fix in our project.

However, the error when running the demo probably needs to be fixed. Not sure why it's occurring tho. @kefahB any ideas?

kefahB commented 3 years ago

Hi, According to this the blank it is a Google Maps issue

I am not able to reproduce the errors on demo.ios ! I have just a TS errors it is about ts4, every think work fine on my side, can you post your NS config please ?

kefahB commented 3 years ago

The gray maps because you need to enable google maps on IOS before getting api key

hypery2k commented 3 years ago

with #440 seems to be work better

kefahB commented 3 years ago

@hypery2k did you try at your own ?

hypery2k commented 3 years ago

I tried your PR and seems to be working better. Found currently only issues that the confirmation on Android regarding location isn't popping up, but that maybe due to app settings

kefahB commented 3 years ago

Hi guys,

There is issue with the custom template, the issue come from Builder.parse #9015 it does not parse xml from View. waiting advise from NS team on this.

@hypery2k I've tested Android, I did not face this problem, the popup it is shown.

funder7 commented 3 years ago

@kefahB i agree with that, I think that many people need this release.

Thanks for your contribution... Great job!

😉

dapriett commented 3 years ago

Hey all, sorry for the delay. Thanks @kefahB and @funder7 for all the hard work on this! I'll get this merged, looks good besides for the infowindow issue. I'll try to take a look when I get a chance.

kefahB commented 3 years ago

Hi every one,

Thanks for every body especially @funder7 for his great job.

@dapriett thank you for merging this .. please update the readme.md to notify peoples which cmd to install for <= NS6.x and > NS7.

Burgov commented 3 years ago

Thanks guys!!