mapbox

Mapbox tiles and Leafletjs

南楼画角 提交于 2019-12-03 02:46:38
问题 I'm trying to load some additional tile layers on my map but I can't quite figure it out. The ones that I currently have I only have thanks to someone that provided a tutorial but didn't say what the other tile options were. Can someone help me with this? var mapboxUrl = 'https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={accessToken}'; var accessToken = 'mySuperSecretToken'; var grayscale = L.tileLayer(mapboxUrl, {id: 'mapbox.light', attribution: '', maxZoom: 20, accessToken:

Mapbox GL JS vs. Mapbox.js

匿名 (未验证) 提交于 2019-12-03 02:44:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: From the Mapbox glossary, Mapbox.js Mapbox.js is a JavaScript library that allows you to add an your interactive map to your website. It is a plugin for Leaflet, and it is an open source library that’s free to use. and Mapbox GL JS Mapbox GL JS is a JavaScript library that uses Mapbox GL to render interactive maps. It’s an open source library that’s free to use. You can add a Mapbox style or a custom style created with Mapbox Studio to your Mapbox GL JS application. and from this answer Mapbox Styles are for use with Mapbox GL and the native

MapBox get div element of Marker

匿名 (未验证) 提交于 2019-12-03 01:04:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am initially pushing MapBox Marker objects to an array via: var el = document.createElement('div' + index); el.className = 'marker'; deviceMarkers.push(new mapboxgl.Marker(el, { offset: [-50 / 2, -50 / 2] }).setLngLat([device.lat, device.lon]).addTo(map)); Elsewhere in the code, I extract the marker via: var deviceMarker = deviceMarkers[index]; I would like to be able to get 'el' from deviceMarker object, in order to alter the icon size, orientation etc. dynamically. How can I extract 'el' as the original div? 回答1: You can use deviceMarker

发布自己的mapbox矢量地图

匿名 (未验证) 提交于 2019-12-03 00:37:01
mapbox 作为一款开源的地图开发平台,优势兼具百度、高德等互联网地图平台和Arcgis、Supermap 等企业级地图平台的特点,是很多企业作为地图项目开发的基础平台,这里根据实际的工作经验,来谈一谈如何发布自己的mapbox矢量地图。并通过mapbox.js调用进行下一步的开发。 发布mapbox 需要很多第三方的软件平台依赖,下图是我整理的具体发布流程图,根据各个流程的主环节,分别对其中用到的软件进行介绍: 原始数据的入口是Geojson格式的文件,关于这种格式文件的详细介绍,推荐这篇博客: https://blog.csdn.net/yaoxiaochuang/article/details/53117379 大家可以用商业的Arcgis、Supermap 等软件对地理数据进行geojson格式文件的导出。 1.tippecanoe github地址: https://github.com/mapbox/tippecanoe ,负责将geojson数据转换成mbtiles文件。 安装说明: git clone git@github .com :mapbox/tippecanoe .git cd tippecanoe make -j make install 使用说明: 使用命令 tippecanoe -z 15 -Z 0 -ps -Bg -o out.mbtiles

开源方案搭建可离线的精美矢量切片地图服务-7.Arcgis Pro企业级应用

匿名 (未验证) 提交于 2019-12-03 00:33:02
1.前言 上篇讲.pbf字体库的时候说到我们使用的字体通过Arcgis Pro 生成,Arcgis Pro样式基于Mapbox做的矢量切片地图渲染。这篇主要讲一下Arcgis Pro矢量切片生成的的具体方法,可以看一下企业级的矢量切片地图对比我们使用Geoserver进行切片的优点。 2.Arcgis Pro介绍 Arcgis Pro是esri公司推出新版arcgis系列软件。企业级矢量切片地图服务应用是新版本中新增的核心功能。矢量切片是区别于传统版本的Arcgis Server地图服务的要点,他可以将Arcmap的.mxd配图直接转为Mapbox的Style,对于已经有成熟的Arcmap配图方案的公司来说,转换到基于Mapbox的矢量切片地图服务可以大大减少配置Mapbox Style的工作量。下面是esri给出的技术路线图: 3.Arcgis Pro矢量切片过程 1.软件下载与试用申请 先注册,再下载软件即可,申请地址如下: https://www.esri.com/zh-cn/arcgis/products/arcgis-pro/trial 2.新建工程文件 3.加载已有的.mxd文件 点击导入地图,加载已有的mxd文件。 4.创建矢量切片索引 这个功能是Arcgis Pro的核心功能,他会根据空间数据的的密度构建矢量切片索引,简单来说对于数据稀疏的地区

开源方案搭建可离线的精美矢量切片地图服务-5.Mapbox离线项目实现

匿名 (未验证) 提交于 2019-12-03 00:33:02
项目成果展示(所有项目文件都在阿里云的共享云虚拟主机上,访问地图可以会有点慢,请多多包涵)。 01:中国地图: http://test.sharegis.cn/mapbox/html/3china.html 02:德国-德累斯顿市: http://test.sharegis.cn/mapbox/html/6germany.html 1.中国地图离线实例 1.通过tms服务 http://localhost:8080/geoserver/gwc/service/tms/1.0.0/china:china_map@EPSG:900913@pbf/{z}/{x}/{y}.pbf 的方式获取矢量切片, 2.示例中还有wmts服务进行设计。源码中maptile文件下包含所有中国地图离线矢量切片。 <! DOCTYPE html > < html > < head > < meta http-equiv ="Content-Type" content ="text/html; charset=utf-8" /> < title > 中国地图 </ title > < meta charset ="utf-8" /> <!-- <script src=‘https://api.mapbox.com/mapbox-gl-js/v0.44.2/mapbox-gl.js‘></script> -->

Leaflet官方教程(二)――Leaflet on Mobile

匿名 (未验证) 提交于 2019-12-03 00:22:01
Leaflet on Mobile 在这个例子中,你将学习到在移动设备中创建全屏地图,并且如何探测和使用用户当前位置。 Preparing the page 首先我们看一下html和CSS代码。为了让map div元素拉伸到整个屏幕,我们要用如下CSS代码。 body { padding : 0 ; margin : 0 ; } html , body , #map { height : 100% ; width : 100vw ; } 我们也要告诉手机浏览器不需要的缩放比例以及通过如下代码设置恰当的大小和位置。 < meta name = "viewport" content = "width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" /> Initializing the map 利用下面代码初始化地图,展示世界地图: var map = L.map( 'map' ).fitWorld(); L.tileLayer( 'https://api.tiles.mapbox.com/v4/ MapID /997/256/{z}/{x}/{y}.png?access_token={accessToken}' , { attribution: 'Map data © <a href=

Mapbox 创建可拖动marker

匿名 (未验证) 提交于 2019-12-03 00:19:01
mapbox的SDK没提供可拖动的marker,可把我坑惨了,网上找了许多都不能用,应该是因为sdk升级导致的,所以只能自己动手写一个了,这里用的版本是6.1.2: 关于MapView的初始化sdk里介绍的都很详细,这里就不讲了,进入主题: 我们在 mapView.getMapAsync()里: 1.保存MapboxMap实例 2.初始化Projection(用于获得坐标点和屏幕像素的映射关系) 3.设置mapView的触摸监听 //手机像素密度 float screenDensity = context.getResources().getDisplayMetrics().density; mapView.getMapAsync(new OnMapReadyCallback() { @Override public void onMapReady(MapboxMap mapboxMap) { //保存MapboxMap实例 map = mapboxMap; //.初始化Projection pj = map.getProjection(); //设置mapView的触摸监听 mapView.setOnTouchListener(new View.OnTouchListener() { @Override public boolean onTouch(View view,

Command PhaseScriptExecution failed with a nonzero exit code when using Mapbox

核能气质少年 提交于 2019-12-02 22:55:48
问题 I have had the bellow error for some time now. I have tried creating new projects fixing the problem within the project Resetting all cocoa pods and more And yet I have still not been able to get rid of this error. Error below: /Users/myUsername/Desktop/MapboxMap117/Pods/Target Support Files/Pods-MapboxMap117/Pods-MapboxMap117-frameworks.sh: line 114: local: `/Users/myUsername/Desktop/MapboxMap117/Pods/Mapbox-iOS-SDK/dynamic/826E141E-8875-3C3B-A106-2B772F8A0684.bcsymbolmap': not a valid

Mapbox GL JS getBounds()/fitBounds()

╄→尐↘猪︶ㄣ 提交于 2019-12-02 20:09:09
I'm using Mapbox GL JS v0.14.2 and I've searched high and low through the documentation and very little is clear about this. If you use the standard JS API, it's very clear to 'fit map to markers' using an example they have provided ( https://www.mapbox.com/mapbox.js/example/v1.0.0/fit-map-to-markers/ ); however the setup when using the GL api is quite different. The GL API has getBounds() ( https://www.mapbox.com/mapbox-gl-js/api/#Map.getBounds ) but because you don't have a named layer, like the standard JS API, so I'm struggling to work out how to use getBounds() at all. I've found this (