Giter VIP home page Giter VIP logo

Comments (6)

Yermo avatar Yermo commented on June 4, 2024 2

I haven't had a chance to look at it. At my present rate of progress I'll be making another major pass through the plugin in early August.

from nativescript-mapbox.

TPham92 avatar TPham92 commented on June 4, 2024 2

@wendt88 I figured out the issue. If you uses setOnMapClickListener or setOnMapLongClickListener function you need to return a boolean. The new Mapbox Native SDK allows for multiple listeners on an event and follows the standard pattern of returning 'true' when a handler has handled the event and others shouldn't. Not returning a boolean from the listener function will cause a crash. https://docs.mapbox.com/android/api/map-sdk/9.2.0/index.html

EX:
mapbox.setOnMapClickListener((point: LatLng) => { console.log("Map clicked at latitude: " + point.lat + ", longitude: " + point.lng); // do stuff ... return true });

from nativescript-mapbox.

wendt88 avatar wendt88 commented on June 4, 2024 1

@TPham92 thx for your feedback! now i found out, that the app crashs on every map (not marker) tap.
I do not have any listener. debugging a bit I found that on tap it gets called checkForCircleClickEvent as default witch returns false and the app crashs.

@Yermo could you fix this (return true) ASAP please?

from nativescript-mapbox.

TPham92 avatar TPham92 commented on June 4, 2024

Any updates on this issue?

from nativescript-mapbox.

Yermo avatar Yermo commented on June 4, 2024

@TPham92 good find.

from nativescript-mapbox.

ignacio68 avatar ignacio68 commented on June 4, 2024

@wendt88 I figured out the issue. If you uses setOnMapClickListener or setOnMapLongClickListener function you need to return a boolean. The new Mapbox Native SDK allows for multiple listeners on an event and follows the standard pattern of returning 'true' when a handler has handled the event and others shouldn't. Not returning a boolean from the listener function will cause a crash. https://docs.mapbox.com/android/api/map-sdk/9.2.0/index.html

EX:
mapbox.setOnMapClickListener((point: LatLng) => { console.log("Map clicked at latitude: " + point.lat + ", longitude: " + point.lng); // do stuff ... return true });

Thank you, It's work very fine in my Nativescript-Vue application.
In Vue you need to make a little change in the code, remove the function arrow:

mapbox.setOnMapClickListener(function(point: LatLng) {
    console.log("Map clicked at latitude: " + point.lat + ", longitude: " + point.lng); 
    // do stuff ... 
    return true 
});

from nativescript-mapbox.

Related Issues (20)

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.