All Projects → huanglii → city-selector-control

huanglii / city-selector-control

Licence: MIT license
A City Selector Control for Mapbox GL JS

Programming Languages

typescript
32286 projects
CSS
56736 projects
HTML
75241 projects
javascript
184084 projects - #8 most used programming language

Labels

Projects that are alternatives of or similar to city-selector-control

Pure Maps
Maps and navigation
Stars: ✭ 136 (+1033.33%)
Mutual labels:  mapbox-gl
mapbox-gl-qml
Unofficial Mapbox GL Native bindings for Qt QML
Stars: ✭ 30 (+150%)
Mutual labels:  mapbox-gl
mapbox-gl
Polymer 2.0 custom element for mapbox-gl-js. Uses WebGL to render interactive maps from vector tiles and Mapbox styles - compatible with deck-gl.
Stars: ✭ 24 (+100%)
Mutual labels:  mapbox-gl
Terramach
Terra Mach is a mapping frontend system to build graphical interfaces for devices.
Stars: ✭ 142 (+1083.33%)
Mutual labels:  mapbox-gl
Osm Liberty
A free Mapbox GL basemap style for everyone
Stars: ✭ 231 (+1825%)
Mutual labels:  mapbox-gl
odoviz
3D Odometry Visualization and Processing Tool
Stars: ✭ 24 (+100%)
Mutual labels:  mapbox-gl
React Mapbox Gl
A React binding of mapbox-gl-js
Stars: ✭ 1,683 (+13925%)
Mutual labels:  mapbox-gl
mapbox-gl-draw-circle
Supports drawing/editing a circle on a Mapbox map.
Stars: ✭ 51 (+325%)
Mutual labels:  mapbox-gl
Ngx Mapbox Gl
Angular binding of mapbox-gl-js
Stars: ✭ 248 (+1966.67%)
Mutual labels:  mapbox-gl
react-map-gl-draw
React Component for Mapbox GL Draw
Stars: ✭ 50 (+316.67%)
Mutual labels:  mapbox-gl
Tilejson Spec
JSON format for describing map tilesets.
Stars: ✭ 175 (+1358.33%)
Mutual labels:  mapbox-gl
Wind Layer
🎏 🚀 wind-layer | a openlayers && amap && bmap && leaflet && mapbox-gl extension to windjs
Stars: ✭ 188 (+1466.67%)
Mutual labels:  mapbox-gl
datahub
Datahub v2
Stars: ✭ 16 (+33.33%)
Mutual labels:  mapbox-gl
React Mapbox Gl Draw
Draw tools for Mapbox with React: 🗺️ react-mapbox-gl + 🖌️ mapbox-gl-draw
Stars: ✭ 136 (+1033.33%)
Mutual labels:  mapbox-gl
maptalks.mapboxgl
MapboxglLayer for maptalks.js
Stars: ✭ 51 (+325%)
Mutual labels:  mapbox-gl
Mapbox Gl Native Android
Interactive, thoroughly customizable maps in native Android powered by vector tiles and OpenGL
Stars: ✭ 135 (+1025%)
Mutual labels:  mapbox-gl
atto
PDF renderer for Mapbox-GL-Native
Stars: ✭ 27 (+125%)
Mutual labels:  mapbox-gl
react-map-gl-cluster
Urbica React Cluster Component for Mapbox GL JS
Stars: ✭ 27 (+125%)
Mutual labels:  mapbox-gl
who-owns-what
Who owns what in nyc?
Stars: ✭ 146 (+1116.67%)
Mutual labels:  mapbox-gl
deck.gl-time-series-widget
A React Time Slider implementation for DECK.GL - (non)temporal data - by CPU filtering ⌛
Stars: ✭ 19 (+58.33%)
Mutual labels:  mapbox-gl

City Selector Control

npm npm

A City Selector Control for mapbox-gl

快速开始

使用 CDN

<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/index.js"></script>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/style.css" rel="stylesheet">
<div id='map' style='width: 800px; height: 600px;'></div>
<script>
  mapboxgl.accessToken = '<your access token here>';
  var map = new mapboxgl.Map({
    container: 'map',
    style: 'mapbox://styles/mapbox/streets-v9'
  });
  map.addControl(new CitySelectorControl(), 'top-right');
</script>

模块化

npm i city-selector-control
import CitySelectorControl from 'city-selector-control'
import 'city-selector-control/dist/style.css'
// 默认选项
map.addControl(new CitySelectorControl(), 'top-right')

// 自定义
const citySelectorOptions = {
  theme: 'dark',
  placeholder: '全国',
  hot: ['110000', '340500'],
  zoom: 12
};
map.addControl(new CitySelectorControl(citySelectorOptions), 'top-right');

选项

# 名称 类型 描述 默认值
1 theme String 主题, 可选 'light''dark'. 'light'
2 placeholder String 初始化时的文本. '请选择'
2 hot Array 热门城市编码,可为空 []. ['440100', '440300', '330100', '510100']
2 zoom Number 选择城市后的缩放级别. 10

截图

theme default

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].