mapbox

Mapnik初学笔记

时间秒杀一切 提交于 2020-01-26 07:20:47
  前言:夏天总是感觉想要睡觉,一心想颓废的我却要一周六天都要处于工作状态,但有些事虽然麻烦,但还是要去做,不由得想起火影忍者里面鹿丸这一个角色,有时候真能理解他的心理状态,或许我应该向他学习:善于思考的头脑+悠然自得的生活状态。前阵子想玩node.js,这几天因为看单反教程和修图给暂停了,现在有一个关于地图的项目要去做,有一个有趣的工具叫做mapnik,不知道你们有没有听说过,反正我是没听说过,不过让我惊喜的是mapnik能和node.js一起玩,哎呦,不错哦,这个叼。 Mapnik: Mapnik 是一个用来开发 GIS (即地理信息系统)应用程序的工具包,其核心是一个 C++ 的共享库提供空间数据访问和可视化的算法和模式。特别是包含一些地理对象,如地图、层、数据源、特征和地理几何等。该共享库支持多种操作系统,可以在多线程环境下很好的运行,主要面向一些提供GIS服务的Web应用开发。 从另一种角度解释,Mapnik是一个开源的Python/Node.js/C++地图渲染引擎,其功能是把数据形式的地图,包含一些地理对象,如地图、层、数据源、特征和地理几何等,通过一个样式表的定义,渲染成位图格式,用来提供网络地图服务(WMS服务)。 矢量瓦片: 矢量瓦片是 将矢量数据转换成图片块 ,用于在线地图,借助瓦片的缓存机制,实现可缩放的地图呈现服务,每一个图片块都代表一个坐标区域。

Adding geoJSON feature attribues to mapbox popup

谁说我不能喝 提交于 2020-01-25 11:03:46
问题 I am looking to add a popup with geoJSON attributes to each book store marker on my map. I have used "layer.feature.properties.name" within the marker.bindpopup method, but am getting a return of "undefined". L.mapbox.accessToken = 'jk.eyJ1IjsdkjfhskjdfhksdskdjflWNCJ9.Ov2O5PtskdljfsdR0lq3Q'; var map = L.mapbox.map('map', 'example.kks3kec4') .setView([38.633, -90.319],12); //add cafe, books store, and university geoJSON layers with styling var bookStore = L.mapbox.featureLayer() .loadURL('book

Custom Mapbox Geocoder Control

↘锁芯ラ 提交于 2020-01-24 04:28:36
问题 I felt like this would be a simple task to do a Google / StackOverflow search for, but I can't seem to find anything on the topic... Anyways, all I want to do is create my own Geocoder Search bar that works OUTSIDE of my mapbox map. For instance, take the Zillow homepage. When you visit the homepage, you are not yet on the map. You can enter a zip code into the search bar provided, press enter (or the button), and then the map appears, centering on the zip code you provided. I basically am

how can I hide tail triangle on popup

馋奶兔 提交于 2020-01-23 02:28:05
问题 image http://pasteio.com/m26f642c81452a5bf67cfc5f0b0f2390c I'm using leaflet to render the mapbox map. There is small triangle on the top of marker; how can I hide it? 回答1: This triangle is controlled by the .leaflet-popup-tip class in css. If you are using standard Leaflet, you should be able to hide the tip by adding the following to your css (after leaflet.css is loaded): .leaflet-popup-tip { width: 0px; height: 0px; } Mapbox actually creates the tip in a slightly different way from

How to set the zIndex layer order for geoJson layers?

不打扰是莪最后的温柔 提交于 2020-01-21 03:20:53
问题 I would like to have certain layers to be always on top of others, no matter in which order they are added to the map. I am aware of bringToFront() , but it does not meet my requirements. I would like to set the zIndex dynamically based on properties. Leaflet has the method setZIndex() , but this apparently does not work for geoJson layers: https://jsfiddle.net/jw2srhwn/ Any ideas? 回答1: Cannot be done for vector geometries. zIndex is a property of HTMLElement s, and vector geometries (lines

MapBox example throws error - mbtiles

╄→гoц情女王★ 提交于 2020-01-17 07:04:45
问题 I am using MapBox example and I have imported my own mbtiles file. I am getting this error: "MB Example[8517:c07] * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '* -[NSURL initFileURLWithPath:]: nil string parameter'. The default mbtiles file is working fine. What am I doing wrong here? 回答1: You are likely not properly bundling the MBTiles file with your app. Be sure that it is added to your app target and is part of the Copy Bundle Resources build phase so

Mapbox 'setMyLocationEnabled' doesn't work

我只是一个虾纸丫 提交于 2020-01-14 18:47:38
问题 I'm trying to enable a location in my mapbox map. However, the line mapboxMap.setMyLocationEnabled(true); fail and Android Studio gives the 'Cannot resolve method setMyLocationEnabled(boolean). I'm using MapBox version 6.0.1 (the latest) in my Gradle: // compile ('com.mapbox.mapboxsdk:mapbox-android-sdk:6.0.1@aar') { // Map BOX transitive=true } When I switch to version 5.1.3 (which I had used in a previous app I made), Android studio detects the method, but on runtime the app throws the

Mapbox 'setMyLocationEnabled' doesn't work

谁说胖子不能爱 提交于 2020-01-14 18:45:50
问题 I'm trying to enable a location in my mapbox map. However, the line mapboxMap.setMyLocationEnabled(true); fail and Android Studio gives the 'Cannot resolve method setMyLocationEnabled(boolean). I'm using MapBox version 6.0.1 (the latest) in my Gradle: // compile ('com.mapbox.mapboxsdk:mapbox-android-sdk:6.0.1@aar') { // Map BOX transitive=true } When I switch to version 5.1.3 (which I had used in a previous app I made), Android studio detects the method, but on runtime the app throws the

How to display geojson data with meters on javascript google map API

狂风中的少年 提交于 2020-01-14 03:35:07
问题 GeoJson file coordinates are in [X, Y] meters not in [lng, lat]. How to display it on google map? GeoJson data { "type": "FeatureCollection", "features": [ { "type": "Feature", "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [ 360590, 555610 ], [ 360590, 555555.0128 ], [ 360590, 555540 ], [ 360592.4439, 555540 ], [ 360600, 555540 ], [ 360600, 555518.8277 ] ] ] ] } } ] } here, [360590, 555610] - [X, Y] coordinates is in meters, Now we need to display this coordinates on google map,

mapboxgl.js versus leaflet.js

自闭症网瘾萝莉.ら 提交于 2020-01-13 20:53:47
问题 I am about to start a web application with the main purpose of displaying a mapbox map, toggle layers and display data based on interactions with the map. I'm wondering should I be using mapboxgl.js AND leaflet.js, mapboxgl.js OR leaflet.js. Everyone keeps saying leaflet is amazing but wondering if mapboxgl gives you the same functionality and performance? I keep reading conflicting things on the internet Would really appreciate the help 回答1: A few words to clarify the difference: mapboxgl