Comments (6)
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.
@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.
@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.
Any updates on this issue?
from nativescript-mapbox.
@TPham92 good find.
from nativescript-mapbox.
@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)
- clusters HOT 8
- Is there a way to have buildings render in 3D?
- MGLCoordinateInCoordinateBounds and other Geometry methods not available in iOS typings
- Event when map has stopped moving HOT 1
- docs need an update. trackUser not working as expected
- args.android is undefined in onMapReady
- [iOS] removePolylines does not work without passing parameter
- Map not displaying on Android HOT 2
- MapBox center map not working
- Black map and 'mapReady' not fired
- Doesn't work with NS7 HOT 10
- Unable to draw lines based on the coordinates that were returned by the directions API
- showUserLocation is not working on ios14 HOT 1
- addPolygon show pop up
- How to add image for internal map. https://docs.mapbox.com/ios/maps/examples/image-source/ HOT 1
- setMapStyle and removeOnDidFailLoadingMapListener
- Doesn't work with nativescript 7 HOT 4
- how to set language?
- mapbox.addImage() doesn't work from locale storage 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-mapbox.