mapbox

Detect software vs hardware webGL render mode

半腔热情 提交于 2019-12-11 06:57:20
问题 I've got an error I'm trying to catch with MapboxGL that doesn't handle when a version of IE switches the webGL render modes from hardware to software. I've been pouring over documentation and console logging pretty much everything I can, but can't find any documented way to find out if webGL is using hardware or software render modes. Any ideas? 回答1: You can check whether or not a browser can run GL JS in a hardware render mode using the mapbox-gl-supported library <script src='mapbox-gl

How can I change a showAnnotation zoom using mapbox for iOS?

╄→尐↘猪︶ㄣ 提交于 2019-12-11 06:46:29
问题 I have a method ( seen below ) which zooms into an annotation which was tapped. func mapView(_ mapView: MGLMapView, didSelect annotation: MGLAnnotation) { print("Tapped") mapView.showAnnotations(pointAnnotations, animated: true)// this does the zooming mapView.deselectAnnotation(annotation, animated: false) } This works, however, I dont like the way it zooms. (currently it, as soon as you tap, starts zooming then somewhat lagging behind it begins to center the object until it gets to the

Unable to hide profile ui (Traffic, Driving, Walking, Cycling)

末鹿安然 提交于 2019-12-11 06:34:29
问题 I do not find options to hide / remove profile ui(Traffic, Driving, Walking, Cycling) from the mapbox direction. Is there any options available? screenshot of profile ui section area. This is the section, I need to hide,Click here to view the profile ui section pic of mapbox directions The code that i have implemented, enableMapboxDirection() { mapboxgl.accessToken = 'pk.eyJ1Ijoid2FsYWEtbWFwIiwiYSI6ImNqN2VuYmluZjBwZ2UzMnBqM20wNnJieWkifQ.2pKH-XbfOZuXzX9pEqGBjw'; var directions = new

“MapboxGeocoder is not a constructor” when trying to initialize a MapboxGeocoder inside the ts of my component

喜你入骨 提交于 2019-12-11 05:14:12
问题 I want to add the mapbox geocoding feature to my web app but when I try to initialize it the error comes in. I've tried searching almost on every library inside the node_modules/mapbox-gl-geocoder for some constructor or something to see if I'm importing the wrong library but no success, If tried reading in the documentation but nothing either. import { MapboxGeocoder } from "mapbox-gl-geocoder"; . . . this.map.addControl(new MapboxGeocoder({ accessToken: mapboxgl.accessToken })); 回答1: import

How to use mapbox “case” expresion on nested properties?

天大地大妈咪最大 提交于 2019-12-11 05:08:49
问题 How to use nested value in order to use case == operator? Something like: this.map.setPaintProperty("somelayer", "fill-color", ["case", ["==", ["properties:some_prop"], someval], "#34c0dd", "#499bbc"] where properties is dict: properties = { some_prop: 1, some_prop2: 2, // and so on } I have tried ["properties.some_prop" ] and ["properties"]["some_prop"] and that does not work as well. And how to print that mapbox query like console.log or something? 回答1: If properties is just the regular

MapBox ability to detect if coordinates is on a body of water?

旧巷老猫 提交于 2019-12-11 05:08:47
问题 First of all, MapBox allows downloading off-line region. Well, downloading off-line region for the Pacific ocean doesn't really make sense. I was sent a ticket coming from the QA department to at least prevent user from ever downloading anything when the coordinates requested is on a body of water (doesn't really matter if it is a river, waterfalls, sewage what not). I have to prevent user accidentally downloading off-line regions that mostly composed of body of water (mostly oceans or seas).

Possible to render react component within mapboxgl.Popup() in .setHTML or .setDOMContent?

二次信任 提交于 2019-12-11 04:57:27
问题 I am wondering if it is possible to render a react component within a mapboxgl.Popup(). Something like this: componentDidMount() { new mapboxgl.Popup() .setLngLat(coordinates) .setHTML(`<div>${<MapPopup />}<p>${moreText}</p></div>`) //.setDOMContent(`${<MapPopup />}`) ????? .addTo(this.props.mapboxMap) }) Or should this be done using ReactDOM.render? ReactDOM.render(<MapPopup />, document.getElementById('root')) This project will have buttons and inputs in the popup that connect to a redux

Enable ng-click on a popup (mapbox)

社会主义新天地 提交于 2019-12-11 04:46:27
问题 First I would like to apologize for my poor english I'm working on a map with marker and popup all declared with mapboxgl, i'm trying to put a ng-click into a button of a popup instantiated in my controller myMap.on('touchstart', function (e) { var features = myMap.queryRenderedFeatures(e.point, { layers: ['points'] }); if (!features.length) { return; } console.log(features); var feature = features[0]; if(popup == undefined){ var html = '<div class="popup-info">'; html += "<h5>"+ feature

Show admin labels for only one country via CartoCSS in Mapbox Studio

倾然丶 夕夏残阳落幕 提交于 2019-12-11 04:13:32
问题 I'd like to show admin labels for only one country on a map of Latin America. I'm new to CartoCSS and can't figure it out. I tried inspecting the labels and couldn't discern any hierarchy in the OSM ids that might help. 来源: https://stackoverflow.com/questions/30676224/show-admin-labels-for-only-one-country-via-cartocss-in-mapbox-studio

MapBox: Markers not showing clickable cursor on mouseover

五迷三道 提交于 2019-12-11 04:09:08
问题 I am moving from leaflet+cloudmade to mapbox and have been doing minor rewrites to my code where necessary. I am refreshing my map and in my previous installment it was easiest to add each marker in to it's own layer and then on refresh to remove all layers and redraw the markers. Here is my current code: function setLeafletMarker(lat, lng, iconType, popupHTML) { popupHTML = typeof popupHTML !== 'undefined' ? popupHTML : ""; var LamMarker = new L.Marker([lat, lng], { icon: iconType }); //.on(