Git Product home page Git Product logo

nativescript-google-maps's People

Contributors

kefahb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

nativescript-google-maps's Issues

Crash on iOS calling GMSMapView.mapWithFrameCamera

This is a continuation of issue 2. While I was able to create an empty map using this plugin, when I added the otherwise empty map page into the app I'm migrating I was still getting a crash when navigating to that page. After many hours of debugging, I have isolated the crash to line 363 in index.ios.ts:

this.nativeView = GMSMapView.mapWithFrameCamera(CGRectZero, this._createCameraPosition());

The camera position is being created correctly. No error is thrown; the app just crashes with out any messages of any kind. It fails on both the current iOS runtime and JSC. The map page is loaded successfully on Android.

As a reference, here's the map-page.xml file in its entirety:

<Page xmlns="http://schemas.nativescript.org/tns.xsd"
  xmlns:lm="@kefah/nativescript-google-maps" 
  navigatingTo="onNavigatingTo" class="page">
  <Page.actionBar>
    <ActionBar title="Map Tester" class="action-bar">
      <NavigationButton text="Back" android.systemIcon="ic_menu_back" tap="onBackTap"/>
    </ActionBar>
  </Page.actionBar>
  <GridLayout >
    <lm:GoogleMaps latitude="35.913623" longitude="-79.055524" zoom="10" mapReady="onMapReady" />
  </GridLayout>
</Page>

And my current package.json:

{
  "name": "myapp",
  "main": "app/app.js",
  "version": "6.0.0",
  "private": true,
  "dependencies": {
    "@bradmartin/nativescript-urlhandler": "^2.0.1",
    "@kefah/nativescript-google-maps": "^1.0.3",
    "@nativescript/appversion": "^2.0.0",
    "@nativescript/core": "~8.1.1",
    "@nativescript/email": "^2.0.5",
    "@nativescript/firebase": "^11.1.3",
    "@nativescript/geolocation": "^8.0.2",
    "@nativescript/iqkeyboardmanager": "^2.0.0",
    "@nativescript/theme": "~3.0.1",
    "@triniwiz/nativescript-toasty": "^4.1.3",
    "base-64": "^1.0.0",
    "nativescript-bitmap-factory": "^1.8.1",
    "nativescript-contacts": "^1.6.4",
    "nativescript-danem-google-maps-utils": "^1.0.18",
    "nativescript-drop-down": "^6.0.0",
    "nativescript-permissions": "^1.3.12",
    "nativescript-phone": "^3.0.2",
    "nativescript-screenshot": "^0.0.2",
    "nativescript-sqlite": "^2.8.6",
    "nativescript-toasty": "^3.0.0-alpha.2",
    "nativescript-ui-listview": "^10.0.2",
    "nativescript-ui-sidedrawer": "^10.0.2",
    "patch-package": "^6.4.7"
  },
  "devDependencies": {
    "@nativescript/android": "8.1.1",
    "@nativescript/ios": "JSC",
    "@nativescript/webpack": "~5.0.0"
  },
  "scripts": {
    "postinstall": "patch-package"
  }
}

At this point I'm looking for any suggestion on what to try or how to debug further. Lacking anything else, I'll start adding the above plugins to a sample project to see if there's any conflicts.

Organize documentation

Put the documentation in order, because now there are places that are misleading

  • copy shortcuts do not correspond to reality
  • in angular section there are no information about registerElement('MapView', () => GoogleMaps);, without this onMapReady handler not fired

StyleBase circular export Android

@kefahB I'm seeing this error during my project build (Android). I see a @ts-ignore in common.ts... could that export be causing the problem?

// @ts-ignore
export { StyleBase };

ERROR in chunk vendor [initial] vendor.js /bitrise/src/node_modules/@kefah/nativescript-google-maps/index.js 2a9c7e95dc08d68bf21e9190814023a8 Circular reexports "../node_modules/@kefah/nativescript-google-maps/index.js".StyleBase --> "../node_modules/@kefah/nativescript-google-maps/common.js".StyleBase -(circular)-> "../node_modules/@kefah/nativescript-google-maps/index.js".StyleBase

Failed to build plugin @kefah/nativescript-google-maps

Having some build issues using this library. Below are the failures. This is with nativescript 8.2.2 and JDK version 17.0.2.

[19:21:34]: ▸ FAILURE: Build completed with 2 failures.
[19:21:34]: ▸ 1: Task failed with an exception.
[19:21:34]: ▸ -----------
[19:21:34]: ▸ * Where:
[19:21:34]: ▸ Build file '/Users/.../platforms/tempPlugin/nativescript_google_maps/build.gradle' line: 232
[19:21:34]: ▸ * What went wrong:
[19:21:34]: ▸ A problem occurred evaluating root project 'nativescript_google_maps'.
[19:21:34]: ▸ > Could not find method compile() for arguments [com.google.android.gms:play-services-maps:18.0.2] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
[19:21:34]: ▸ * Try:
[19:21:34]: ▸ > Run with --stacktrace option to get the stack trace.
[19:21:34]: ▸ > Run with --info or --debug option to get more log output.
[19:21:34]: ▸ > Run with --scan to get full insights.
[19:21:34]: ▸ ==============================================================================
[19:21:34]: ▸ 2: Task failed with an exception.
[19:21:34]: ▸ -----------
[19:21:34]: ▸ * Where:
[19:21:34]: ▸ Build file '/Users/.../platforms/tempPlugin/nativescript_google_maps/build.gradle' line: 210
[19:21:34]: ▸ * What went wrong:
[19:21:34]: ▸ A problem occurred configuring root project 'nativescript_google_maps'.
[19:21:34]: ▸ > Could not get unknown property 'generateReleaseBuildConfig' for root project 'nativescript_google_maps' of type org.gradle.api.Project.
[19:21:34]: ▸ * Try:
[19:21:34]: ▸ > Run with --stacktrace option to get the stack trace.
[19:21:34]: ▸ > Run with --info or --debug option to get more log output.
[19:21:34]: ▸ > Run with --scan to get full insights.
[19:21:34]: ▸ ==============================================================================
[19:21:34]: ▸ * Get more help at https://help.gradle.org
[19:21:34]: ▸ BUILD FAILED in 2s
[19:21:35]: ▸ Failed to build plugin @kefah/nativescript-google-maps :
[19:21:35]: ▸ Error: Command ./gradlew failed with exit code 1

isInfoWindowShown always returns true

This is the same problem reported in dapriett's Marker isInfoWindowShown method incorrectly calls showInfoWindow on Android, but apparently was not included when the fork was made ('tho there is a slightly annoying console.log there).

Here's the code in question, index.android.ts:

    isInfoWindowShown(): boolean {
        console.log(">>> ", this._android.isInfoWindowShown())
        return (this._isMarker) ? this._android.showInfoWindow() : false;
    }

The correct code should be

    isInfoWindowShown(): boolean {
        return (this._isMarker) ? this._android.isInfoWindowShown() : false;
    }

Because this plugin ships as an .aar file I don't think I can patch it directly via patch-package :-(.

Any way we can get this fixed?

Nativescript 8

Is this working for Nativescript 8.
I have checked out and try to use your plugin and it works on iOS, but Android still not able to make it work. The map, doesn't show up
Screen Shot 2022-01-10 at 10 16 00
.

Keyed Info Window Template support

The dapriett version of this plugin supports keyed info windows, as described in the associated readme:

           <!-- Keyed Info Window Templates -->   
            <maps:mapView.infoWindowTemplates>
                <template key="testWindow">
                    <StackLayout orientation="vertical" width="160" height="160" >
                        <Image src="res://icon" stretch="fill"  height="100" width="100" className="infoWindowImage" />
                        <Label text="Let's Begin!" className="title" />
                    </StackLayout>
                </template>
            </maps:mapView.infoWindowTemplates>

This text is excluded from this repository's readme, and when I attempt to load my map page (which includes such templates) I get the error,

***** Fatal JavaScript exception - application has been terminated. *****
NativeScript encountered a fatal error: Uncaught Error: Building UI from XML. @./views/map-page.xml:93:13
> Module 'Template' not found for element 'Template'.
> instanceType is not a constructor

Can keyed info window templates be supported? It would be a big deal if they're not.

{N} 8.1 iOS app crashes immediately attempting to navigate to map page

I'm working with your plugin as I migrate a large JavaScript project from {N} 6.8 to 8.1. First, I appreciate you creating this fork, as Google Maps are a key part of my app. I'm starting on iOS, and I've made these changes so far in my map-page.xml file:

- xmlns:maps="nativescript-google-maps-sdk"  
+ xmlns:maps="@kefah/nativescript-google-maps"

and

- maps:mapView id="locmap" latitude="{{ latitude }}" longitude="{{ longitude }}"
+ maps:GoogleMaps id="locmap" latitude="{{ latitude }}" longitude="{{ longitude }}" 

The app crashes immediately without any thrown errors when navigating to that page, with the navigatingTo event never firing. Is there more that's required here? Here's the complete, stripped-down version of the xml file:

<Page xmlns="http://schemas.nativescript.org/tns.xsd"
  xmlns:maps="@kefah/nativescript-google-maps"
  navigatingTo="onNavigatingTo" navigatingFrom="onNavigatingFrom" loaded="onLoaded" class="page">
  <Page.actionBar>
    <ActionBar title="{{ tappedItem.title }}" class="action-bar">
      <NavigationButton text="Back" android.systemIcon="ic_menu_back" tap="{{backTap}}"/>
    </ActionBar>
  </Page.actionBar>
  <GridLayout >
    <maps:GoogleMaps id="locmap" latitude="{{ latitude }}" longitude="{{ longitude }}" zoom="{{ zoom }}" mapReady="onMapReady" />
  </GridLayout>
</Page>

I'll be happy to update the readme file if appropriate.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.