mapbox

SwiftUI Button interact with Map

让人想犯罪 __ 提交于 2020-01-13 19:22:31
问题 I'm totally new with Swift and SwiftUI and for a project group, I need to develop my first IOS app. I can display a map with Mapbox but I don't know how to follow my user when I click on a button. I don't know how to interact my button with my struct MapView This is my code: MapView.swift: import Mapbox struct MapView: UIViewRepresentable { let mapView: MGLMapView = MGLMapView(frame: .zero) func makeCoordinator() -> Coordinator { Coordinator(self) } func makeUIView(context:

Mapbox GL JS Image Overlay Coordinates Precision Issue

十年热恋 提交于 2020-01-13 07:28:08
问题 I'm facing a precision issue with Mapbox GL JS when placing an image overlay on the map with 4 corners coordinates, there is a shift from the expected position by 50-250 m. To reach this conclusion and find this bug, the projection of the image was compared to Leaflet and QGIS, both of them shows the same position of the image but Mapbox GL JS is showing a shift. I think this may be a bug in the framework that needs to be fixed. I'm using React Mapbox GL JS and was able to recreate this issue

Mapbox Web GL JS - querySourceFeatures() function with vector tile source

强颜欢笑 提交于 2020-01-13 06:31:26
问题 I've got a vector tileset on Mapbox that I created by uploading a geojson file comprising polygons representing particular suburbs in Victoria, Australia. My vector tileset has three properties - suburb, state, postcode - corresponding to the feature properties in the geojson. I can also successfully query those properties via the Mapbox web gl js library to get an accurate map. For example I've got a map working that shows a popup when I click a highlighted polygon, and the popup correctly

基于leftlet的经历地图相册

我们两清 提交于 2020-01-12 16:14:51
之前在一个专栏课里面看到一个旅游地图相册的 Demo,一直想把它总结下,放到博客里面。 一、底图切换和版权信息,此处调用了七种地图服务,其中前五个使用了插件调用地图底图,最后两个调用 Mapbox 地图底图。 //自定义版权信息 var mapAttr = 'Map data © <a href="https://xiaozhuanlan.com/webgis/">《ocean工作室》</a> contributors, ' + '<a href="http://ocean.com/">ocean</a>, ' + 'Imagery © <a href="https://www.mapbox.com/">Mapbox</a>'; //mapbox 地图服务URL var mapboxUrl = 'https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=自己申请的PK值'; // 地图中心点,武汉 var centerPoint = [30.59276, 114.30525]; // 定义两个图层,影像图层和街道图层(这里是用了mapbox地图服务) //定义图层时把版权信息直接传入 var satellite = L.tileLayer(mapboxUrl, { id: 'mapbox.satellite'

Mapbox Android: How to get directions from current location to a destination you choose?

邮差的信 提交于 2020-01-11 04:12:10
问题 Okay so I am fairly new to Mapbox, I have used GMaps prior to this but I found that Mapbox is more capable of doing what I need, the problem is I have hit a bit of a wall. I have used a combination of the examples available on their site e.g. https://www.mapbox.com/android-sdk/examples/geocoding and https://www.mapbox.com/android-sdk/examples/directions I am trying to allow the user to search a destination and then have it turned into coordinates which will be used to plot in the map. I then

Mapbox and Leaflet Draw edit only 1 group

ⅰ亾dé卋堺 提交于 2020-01-07 06:56:14
问题 I want to add multiple layergroup or featuregroup objects or something else if there's a better way on a map that can contain multiple polygons in each. I want these groups to be distinguishable so they can be used in conjunction with datatables and the leaflet draw tool so that when I select a row within datatables, only the polygons within the related group can be edited or deleted using the draw tool and any new polygons are only added to that group. I've done this before with only a

Constrain Mapbox panning north/south only?

柔情痞子 提交于 2020-01-07 02:54:28
问题 Anyone know how to constrain the panning in a Mapbox map only using north/south bounds? What I would like to do is use the world copy so that users can continuously pan east to west, but restrict the north and south panning so that you can't pan outside of the map tiles (which I find super annoying). I'm currently using a maxbounds when initializing the map to prevent panning into the white tiles above and below the poles, but that's a no-go with world copying. 回答1: You can use -Infinity west

Mapbox Geolocation, how to load into map?

五迷三道 提交于 2020-01-07 00:35:54
问题 I have being playing around with MapBox and I am having some issues with getting the GeoLocation API to send data back to the map and update the it. This is what I got right now: mapboxgl.accessToken = 'TOKEN-HERE'; var map = new mapboxgl.Map({ container: 'map', // container id style: 'mapbox://styles/mapbox/streets-v9', center: [-0.968539, 54.562917], zoom: 9 }); map.on('style.load', function() { map.addSource("myMap", { "type": "geojson", "data": "https://api.mapbox.com/geocoding/v5/mapbox

Mapbox Geolocation, how to load into map?

霸气de小男生 提交于 2020-01-07 00:35:07
问题 I have being playing around with MapBox and I am having some issues with getting the GeoLocation API to send data back to the map and update the it. This is what I got right now: mapboxgl.accessToken = 'TOKEN-HERE'; var map = new mapboxgl.Map({ container: 'map', // container id style: 'mapbox://styles/mapbox/streets-v9', center: [-0.968539, 54.562917], zoom: 9 }); map.on('style.load', function() { map.addSource("myMap", { "type": "geojson", "data": "https://api.mapbox.com/geocoding/v5/mapbox

代价和收益-mbtiles规范

和自甴很熟 提交于 2020-01-06 22:10:34
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 前一段时间,在给客户导出瓦片数据作为提交成果。最终导出了512x512,总共8级,这大约已经是100万比例尺的水平,接近数据最高分辨率了。虽然数据量不是很大,但文件很小很碎,经过优化处理之后,一个瓦片只有几k,而且,由于地球大面积是海洋,而海洋的部分的显示效果都是一样的,也就是说,70%数量的瓦片都是一样的,我在想,这么多重复的内容都是冗余啊,有没有可能把这些瓦片都归结成同一个,这样,文件数量可以至少减少到原先的一半以下。有人跟我说,MBTiles格式可能可以实现,我就去查了一下。 https://github.com/mapbox/mbtiles-spec 这个是mapbox给出的数据格式说明,这是一种基于Sqlite数据库,将地图栅格(也可以是矢量或三维模型)瓦片存储为二进制字段,通过对应的xyz属性数据快速调用和查找,返回给客户端的。根据Sqlite的作者所说,通过数据库访问文件,要比直接访问磁盘文件速度快上35%,当然,我忘了是不是基于ssd了。当然我有更好的加快访问速度的方式,比如映射内存虚拟磁盘,将所有数据存放于内存,根本不用去考虑做缓存的问题。 但在阅读这个说明的时候,发现他们只是将磁盘中的内容直接写入的数据库,并没有对数据进行重复校验,也没有对重复的瓦片进行合并和映射。我觉得,如果是我来实现