mapbox

Mapbox - extruding lines

怎甘沉沦 提交于 2019-12-14 02:22:57
问题 Is it possible to apply fill-extrusion for a GeoJSON LineString feature? Basically I'm looking for a way to draw lines (can be 1 line or multiple connected) in a 3d mode with z-offset. If that's not possible, maybe this can be done with a polygon instead? Like, converting my lines to polygons (how can i do that?) 回答1: What you're asking for isn't yet implemented, but ticketed in Mapbox GL JS at https://github.com/mapbox/mapbox-gl-js/issues/3993. For now you'll need to opt for your second

How to add linewidth property to MGLFillStyleLayer in mapbox ios sdk?

夙愿已清 提交于 2019-12-14 02:17:57
问题 I have to add polygon features in the 'MGLFillStyleLayer' with 'MGLPolygonFeature' but the problem is I can't change the outline width. 回答1: The line width for a MGLFillStyleLayer currently cannot be changed. The suggested workaround is to use the same source to create a MGLLineStyleLayer, then insert the line layer above the fill layer. I can add a line layer to this example with the following code: let lineLayer = MGLLineStyleLayer(identifier: "line-layer", source: source) lineLayer

Layer Circumference Length in Leaflet.js

怎甘沉沦 提交于 2019-12-13 21:07:18
问题 Any idea how to get the Circumference length of the shapes in a layer in MapBox/Leaflet.js? I managed to get the area using this example (even though it is sometimes negative!?). It does not have circumference/perimeter though. Thanks! 回答1: For L.Circle you can calculate the circumference from it's radius: L.Circle.include({ circumference: function () { return 2 * Math.PI * this.getRadius(); } }); var circle = new L.Circle(...), circumference = circle.circumference(); For L.Polyline you'll

Manipulate the map in mapbox

*爱你&永不变心* 提交于 2019-12-13 20:15:34
问题 The code presented here. Gives us a mapbox, which I also use in my code. Here is the actual code from the link: <!DOCTYPE html> <html> <head> <meta charset='utf-8' /> <title>Display a map</title> <meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' /> <script src='https://api.tiles.mapbox.com/mapbox-gl-js/v1.4.1/mapbox-gl.js'></script> <link href='https://api.tiles.mapbox.com/mapbox-gl-js/v1.4.1/mapbox-gl.css' rel='stylesheet' /> <style> body { margin:0; padding:0;

Remove or move 'Reset North' button on Android studio for Mapbox

时光毁灭记忆、已成空白 提交于 2019-12-13 18:49:02
问题 I was wondering if there was a way to move the location of the 'Reset North' button that is generated by Mapbox. It is in the top right of the screen where my EditText (search) is, so my EditText blocks it. Other option is adding a custom "Reset North" button, but I would still need to move or remove the original function. I have tired mapboxMap.getUiSettings().setCompassMargins(left, top, right, bottom); but the app crashes Error: 'on a null object reference' Link to previous question, no

Webshot gem is not capturing the finished page

半世苍凉 提交于 2019-12-13 18:45:44
问题 I am attempting to take screen shots of maps generated with mapbox. I successfully took screenshots until I started storing my data in a file, which mapbox recommends if you have a lot of data. (https://www.mapbox.com/help/working-with-large-geojson-data/#store-geojson-at-url) Now I get a white screen. I've added a timeout. It doesn't seem to matter how long I wait. I believe the data should be loaded via Ajax. I'm running this against a locally running web server. When I view the page using

Supplement local data for geocoder using Mapbox GL JS

混江龙づ霸主 提交于 2019-12-13 17:14:43
问题 I am running a map of the location of a few facilities with their name and coordinate data. I want the geocoder to be able to search for the name of the facility. Mapbox has a great example of this, but their example shows a use case where the dataset is loaded INTO the actual code. My dataset is much larger and it is currently located on a .geojson file in the project folder. How can I transform this code to work for my example? I tried to call back my dataset into the geocoder code by using

How to rotate car marker image in Mapbox 3.6?

天涯浪子 提交于 2019-12-13 16:53:22
问题 I want to rotate marker image as per the route direction.I had implemented map using Map box SDK. Coordinates & directions are fetched through webservice. I tried imageForMarker but it didnt work. Implemetation is as follow func mapView(_ mapView: MGLMapView, imageFor annotation: MGLAnnotation) -> MGLAnnotationImage? { let img = imageRotatedByDegrees(oldImage: UIImage(named: "car")!, deg: CGFloat(self.bearing)) return MGLAnnotationImage(image: img, reuseIdentifier: "car") } func

Search for markers in a markercluster group Leaflet-MarkerCluster

南楼画角 提交于 2019-12-13 15:46:35
问题 I am using Leaflet.markercluster to cluster my markers in my Mapbox Map. The markers are to be populated using a json file. All I need is a search feature which can popup the requisite marker based on search string. I got to know about Leaflet-search, but am unable to integrate it with my code. How should I go about this? 回答1: Simply iterate through your layer group (like your Marker Cluster Group), e.g. using eachLayer(fn), test against the marker attributes, and if you find your target

importing iconurl from a csv in mapbox

爷,独闯天下 提交于 2019-12-13 08:09:15
问题 I want to import a number of markers onto a mapbox map, where a csv file defines the name of the icon to use. The csv table looks like this: pID,qID,longitude,latitude,bearing(degree),orientation(36),color,icon PID1,QID35,90.39210677,23.7756582,80.1120824,8,3,3.png PID1,QID40,90.39045721,23.77525565,216.2854365,22,6,6.png I am using omnivore to convert this csv to geojson (at least I think that's what omnivore is doing) The code I'm using is down below: <!DOCTYPE html> <html> <head> <meta