- Accessible Map
- Advanced Mapbox Vector Tiles
- 高级地图定位
- 地图加载 GIF 动图
- ArcGIS REST Feature Service
- Attributions
- 波段对比度调节
- Bing Maps
- Box Selection
- Canvas Tiles
- CartoDB source example
- Change Tile Layer Style
- Cloud Optimized GeoTIFF (COG)
- Cloud Optimized GeoTIFF (COG) from a Blob
- Clustered Features
- Color Manipulation
- Constrained Extent
- Constrained Zoom
- Custom Animation
- Custom Canvas Tiles
- 自定义圆形渲染
- 自定义控件
- 自定义拖拽上传展示数据(KMZ)
- 自定义拖拽上传展示数据 (MVT 预览)
- 自定义触发器渲染
- 自定义交互
- 地图自定义 dom 元素(element)
- 自定义鹰眼
- 自定义面状图形要素样式
- 自定义瓦片 WMS
- 自定义提示信息
- d3 集成
- 数据瓦片
- 设备定位
- 拖拽加载数据
- 拖拽 Image Vector
- 拖拽,旋转和缩放
- 绘制和修改图形要素(Features)
- 绘制和编辑测地线(Geodesic)圆
- 绘制图形要素(Feature)
- 绘制规则图形
- 动态聚合
- 动画展示数据
- 地震位置聚合图
- 地震位置热力图
- 渲染 KML 中的地震数据
- 自定义图形渲染地震数据
- 可编辑的 ArcGIS REST 图形要素服务
- EPSG:4326
- 导出 PDF 示例
- 范围(Extent)交互
- 外部地图
- 使用 WebGL 过滤图形要素
- 航班飞行动画
- Fractal 渲染
- 自由绘制
- 全屏控件
- 带有扩展element的全屏控件
- 全屏拖拽,旋转,缩放
- Geographic Coordinates
- Geographic Editing
- GeoJSON
- 集成 geojson-vt
- 地理位置
- GeoTIFF 瓦片金字塔
- GeoTIFF with Overviews
- GPX 数据
- 高 DPI WMTS
- 点击容许偏差
- Icon 比例
- Icon 颜色
- Icon 位置修改
- Icon 像素操作
- Icon Sprites with WebGL
- Icon 渲染
- IGC 数据
- IGN WMTS
- IIIF 影像 API
- ArcGIS 图像地图服务
- 图片过滤
- 图像载入事件
- 图像重投影
- 即时渲染 (地理)
- 插值
- 集成 JSTS
- KML
- Layer 裁剪
- 图层组
- 图层 最小/最大 分辨率
- 图层透明度
- 图层鼠标透视
- 图层卷帘
- 图层卷帘 (WebGL)
- 图层层级(Z-Index)
- 图层缩放限制
- 懒加载资源
- 限制图层范围
- 线段箭头
- 载入中旋转动画
- 局部的 OpenStreetMap
- 鼠标放大镜效果
- 地图打印(导出)
- 地图经纬网格
- 地图链接地址
- Mapbox 矢量图层
- Mapbox 矢量瓦片
- Mapbox-gl 图层
- MapGuide Untiled
- 地图点图标动画
- 测量
- 使用矢量样式测量
- 修改图形要素(Features)
- 修改图形要素测试
- 显示鼠标位置
- 地图平移(拖拽)结束事件
- 定位控件
- NDVI from a Sentinel 2 COG
- 动态颜色斜率 NDVI
- NDVI+NDWI from two 16-bit COGs
- OGC 地图瓦片
- OGC 地图瓦片 (地理)
- OGC 矢量瓦片
- OpenStreetMap 重投影
- 带有比例尺控件的 OpenStreetMap 重投影
- OSM 矢量瓦片
- OSM XML
- 覆盖物(Overlay)
- 鹰眼地图控件
- 页面滚动
- 拖拽和页面滚动
- Permalink
- Pinch Zoom
- Popup
- Preload Tiles
- 按比例导出地图
- 投影和比例尺
- 栅格重投影
- 栅格资源
- 区域增长
- Regular Shapes
- Render geometries to a canvas
- Rendering 16-bit NumpyTiles
- Reprojection with EPSG.io Search
- Reusable Source
- Rich Text Labels
- Scale and Rotate using Modify Interaction
- Scale Line
- Sea Level
- Sea Level (with WebGL)
- Select Features
- Select Features by Hover
- Select multiple Features
- Semi-Transparent Layer
- Shaded Relief
- Shaded Relief (with WebGL)
- Shared Views
- Simple Map
- Single Image WMS
- Single Image WMS with Proj4js
- Smoothing lines using Chaikins algorithm
- Snap Interaction
- Sphere Mollweide
- Stamen Tiles
- Static Image
- Street Labels
- Style renderer
- Styling feature with CanvasGradient or CanvasPattern
- SVG Layer
- Synthetic Lines
- Synthetic Points
- Teleporting Maps
- Tile Load Events
- Tile Transitions
- Tiled ArcGIS MapServer
- Tiled WMS
- Tiled WMS Wrapping
- TileJSON
- Timezones in KML
- Tissot Indicatrix
- TopoJSON
- topolis integration
- Tracing around a polygon
- Translate Features
- turf.js
- UTFGrid
- Vector Clipping Layer
- Vector Image Layer
- Vector Label Decluttering
- Vector Labels
- Vector Labels - Justify Text
- Vector Layer
- Vector Layer Hit Detection
- Vector Tile Info
- Vector Tile Selection
- Vector tiles created from a Mapbox Style object
- Vector tiles in EPSG:4326
- Vector tiles rendered in an offscreen canvas
- View Animation
- View Min-Zoom
- View Padding
- View Rotation
- WebGL points layer
- WebGL Tile Layer Styles
- WebGL Tiles
- WebGL Vector Layer
- WFS
- WFS - GetFeature
- WFS with geographic coordinates
- Wind Arrows
- WKB
- WKT
- WMS 512x256 Tiles
- WMS Capabilities Parsing
- WMS GetFeatureInfo (Image Layer)
- WMS GetFeatureInfo (Layers)
- WMS GetFeatureInfo (Tile Layer)
- WMS GetLegendGraphic
- WMS 时序渲染
- 无投影 WMS
- WMTS
- WMTS Capabilities 解析
- 从 Capabilities 加载 WMTS
- WMTS 瓦片转换
- XYZ
- XYZ Esri
- XYZ 视网膜瓦片
- 缩放滑块
- Zoomify
文章来源于网络收集而来,版权归原创者所有,如有侵权请及时联系!
Vector Labels
Example of GeoJSON features with labels.
This example showcases a number of options that can be set on text styles. When "Text/Wrap" is chosen (for example for the line features), the label is wrapped by inserting the character \n
, which will create a multi-line label. The "Open Sans" web font will be loaded on demand, to show dynamic font loading.
main.js
import 'ol/ol.css';
import GeoJSON from 'ol/format/GeoJSON';
import Map from 'ol/Map';
import View from 'ol/View';
import {
Circle as CircleStyle,
Fill,
Stroke,
Style,
Text,
} from 'ol/style';
import {OSM, Vector as VectorSource} from 'ol/source';
import {Tile as TileLayer, Vector as VectorLayer} from 'ol/layer';
let openSansAdded = false;
const myDom = {
points: {
text: document.getElementById('points-text'),
align: document.getElementById('points-align'),
baseline: document.getElementById('points-baseline'),
rotation: document.getElementById('points-rotation'),
font: document.getElementById('points-font'),
weight: document.getElementById('points-weight'),
size: document.getElementById('points-size'),
height: document.getElementById('points-height'),
offsetX: document.getElementById('points-offset-x'),
offsetY: document.getElementById('points-offset-y'),
color: document.getElementById('points-color'),
outline: document.getElementById('points-outline'),
outlineWidth: document.getElementById('points-outline-width'),
maxreso: document.getElementById('points-maxreso'),
},
lines: {
text: document.getElementById('lines-text'),
align: document.getElementById('lines-align'),
baseline: document.getElementById('lines-baseline'),
rotation: document.getElementById('lines-rotation'),
font: document.getElementById('lines-font'),
weight: document.getElementById('lines-weight'),
placement: document.getElementById('lines-placement'),
maxangle: document.getElementById('lines-maxangle'),
overflow: document.getElementById('lines-overflow'),
size: document.getElementById('lines-size'),
height: document.getElementById('lines-height'),
offsetX: document.getElementById('lines-offset-x'),
offsetY: document.getElementById('lines-offset-y'),
color: document.getElementById('lines-color'),
outline: document.getElementById('lines-outline'),
outlineWidth: document.getElementById('lines-outline-width'),
maxreso: document.getElementById('lines-maxreso'),
},
polygons: {
text: document.getElementById('polygons-text'),
align: document.getElementById('polygons-align'),
baseline: document.getElementById('polygons-baseline'),
rotation: document.getElementById('polygons-rotation'),
font: document.getElementById('polygons-font'),
weight: document.getElementById('polygons-weight'),
placement: document.getElementById('polygons-placement'),
maxangle: document.getElementById('polygons-maxangle'),
overflow: document.getElementById('polygons-overflow'),
size: document.getElementById('polygons-size'),
height: document.getElementById('polygons-height'),
offsetX: document.getElementById('polygons-offset-x'),
offsetY: document.getElementById('polygons-offset-y'),
color: document.getElementById('polygons-color'),
outline: document.getElementById('polygons-outline'),
outlineWidth: document.getElementById('polygons-outline-width'),
maxreso: document.getElementById('polygons-maxreso'),
},
};
const getText = function (feature, resolution, dom) {
const type = dom.text.value;
const maxResolution = dom.maxreso.value;
let text = feature.get('name');
if (resolution > maxResolution) {
text = '';
} else if (type == 'hide') {
text = '';
} else if (type == 'shorten') {
text = text.trunc(12);
} else if (
type == 'wrap' &&
(!dom.placement || dom.placement.value != 'line')
) {
text = stringDivider(text, 16, '\n');
}
return text;
};
const createTextStyle = function (feature, resolution, dom) {
const align = dom.align.value;
const baseline = dom.baseline.value;
const size = dom.size.value;
const height = dom.height.value;
const offsetX = parseInt(dom.offsetX.value, 10);
const offsetY = parseInt(dom.offsetY.value, 10);
const weight = dom.weight.value;
const placement = dom.placement ? dom.placement.value : undefined;
const maxAngle = dom.maxangle ? parseFloat(dom.maxangle.value) : undefined;
const overflow = dom.overflow ? dom.overflow.value == 'true' : undefined;
const rotation = parseFloat(dom.rotation.value);
if (dom.font.value == "'Open Sans'" && !openSansAdded) {
const openSans = document.createElement('link');
openSans.href = './resources/css.css?family=Open+Sans';
openSans.rel = 'stylesheet';
document.getElementsByTagName('head')[0].appendChild(openSans);
openSansAdded = true;
}
const font = weight + ' ' + size + '/' + height + ' ' + dom.font.value;
const fillColor = dom.color.value;
const outlineColor = dom.outline.value;
const outlineWidth = parseInt(dom.outlineWidth.value, 10);
return new Text({
textAlign: align == '' ? undefined : align,
textBaseline: baseline,
font: font,
text: getText(feature, resolution, dom),
fill: new Fill({color: fillColor}),
stroke: new Stroke({color: outlineColor, width: outlineWidth}),
offsetX: offsetX,
offsetY: offsetY,
placement: placement,
maxAngle: maxAngle,
overflow: overflow,
rotation: rotation,
});
};
// Polygons
function polygonStyleFunction(feature, resolution) {
return new Style({
stroke: new Stroke({
color: 'blue',
width: 1,
}),
fill: new Fill({
color: 'rgba(0, 0, 255, 0.1)',
}),
text: createTextStyle(feature, resolution, myDom.polygons),
});
}
const vectorPolygons = new VectorLayer({
source: new VectorSource({
url: 'data/geojson/polygon-samples.geojson',
format: new GeoJSON(),
}),
style: polygonStyleFunction,
});
// Lines
function lineStyleFunction(feature, resolution) {
return new Style({
stroke: new Stroke({
color: 'green',
width: 2,
}),
text: createTextStyle(feature, resolution, myDom.lines),
});
}
const vectorLines = new VectorLayer({
source: new VectorSource({
url: 'data/geojson/line-samples.geojson',
format: new GeoJSON(),
}),
style: lineStyleFunction,
});
// Points
function pointStyleFunction(feature, resolution) {
return new Style({
image: new CircleStyle({
radius: 10,
fill: new Fill({color: 'rgba(255, 0, 0, 0.1)'}),
stroke: new Stroke({color: 'red', width: 1}),
}),
text: createTextStyle(feature, resolution, myDom.points),
});
}
const vectorPoints = new VectorLayer({
source: new VectorSource({
url: 'data/geojson/point-samples.geojson',
format: new GeoJSON(),
}),
style: pointStyleFunction,
});
const map = new Map({
layers: [
new TileLayer({
source: new OSM(),
}),
vectorPolygons,
vectorLines,
vectorPoints,
],
target: 'map',
view: new View({
center: [-8161939, 6095025],
zoom: 8,
}),
});
document
.getElementById('refresh-points')
.addEventListener('click', function () {
vectorPoints.setStyle(pointStyleFunction);
});
document.getElementById('refresh-lines').addEventListener('click', function () {
vectorLines.setStyle(lineStyleFunction);
});
document
.getElementById('refresh-polygons')
.addEventListener('click', function () {
vectorPolygons.setStyle(polygonStyleFunction);
});
/**
* @param {number} n The max number of characters to keep.
* @return {string} Truncated string.
*/
String.prototype.trunc =
String.prototype.trunc ||
function (n) {
return this.length > n ? this.substr(0, n - 1) + '...' : this.substr(0);
};
// https://stackoverflow.com/questions/14484787/wrap-text-in-javascript
function stringDivider(str, width, spaceReplacer) {
if (str.length > width) {
let p = width;
while (p > 0 && str[p] != ' ' && str[p] != '-') {
p--;
}
if (p > 0) {
let left;
if (str.substring(p, p + 1) == '-') {
left = str.substring(0, p + 1);
} else {
left = str.substring(0, p);
}
const right = str.substring(p + 1);
return left + spaceReplacer + stringDivider(right, width, spaceReplacer);
}
}
return str;
}
index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Vector Labels</title>
<!-- Pointer events polyfill for old browsers, see https://caniuse.com/#feat=pointer -->
<script src="https://unpkg.com/elm-pep"></script>
<!-- The line below is only needed for old environments like Internet Explorer and Android 4.x -->
<script src="https://cdn.polyfill.io/v3/polyfill.min.js?features=fetch,requestAnimationFrame,Element.prototype.classList,URL,TextDecoder,Number.isInteger"></script>
<style>
.map {
width: 100%;
height:400px;
}
.edit-form {
display: inline-block;
margin: 5px;
padding: 10px;
border: 1px solid black;
white-space: nowrap;
}
.edit-form h2 {
font-size: 1.5em;
}
.edit-form input[type="button"] {
float: right;
}
.edit-form-elem label {
display: inline-block;
width: 85px;
}
.edit-form-elem input[type="text"],
.edit-form-elem select {
width: 130px;
}
</style>
</head>
<body>
<div id="map" class="map"></div>
<div class="edit-form">
<input id="refresh-points" type="button" value="Refresh" />
<h2>Points</h2>
<div class="edit-form-elem">
<label for="points-text">Text: </label>
<select id="points-text">
<option value="hide">Hide</option>
<option value="normal">Normal</option>
<option value="shorten" selected="selected">Shorten</option>
<option value="wrap">Wrap</option>
</select>
<br />
<label for="points-maxreso" title="Max Resolution Denominator">MaxReso.: </label>
<select id="points-maxreso">
<option value="38400">38,400</option>
<option value="19200">19,200</option>
<option value="9600">9,600</option>
<option value="4800">4,800</option>
<option value="2400">2,400</option>
<option value="1200" selected="selected">1,200</option>
<option value="600">600</option>
<option value="300">300</option>
<option value="150">150</option>
<option value="75">75</option>
<option value="32">32</option>
<option value="16">16</option>
<option value="8">8</option>
</select>
<br />
<label for="points-align">Align: </label>
<select id="points-align">
<option value="center" selected="selected">Center</option>
<option value="end">End</option>
<option value="left">Left</option>
<option value="right">Right</option>
<option value="start">Start</option>
</select>
<br />
<label for="points-baseline">Baseline: </label>
<select id="points-baseline">
<option value="alphabetic">Alphabetic</option>
<option value="bottom">Bottom</option>
<option value="hanging">Hanging</option>
<option value="ideographic">Ideographic</option>
<option value="middle" selected="selected">Middle</option>
<option value="top">Top</option>
</select>
<br />
<label for="points-rotation">Rotation: </label>
<select id="points-rotation">
<option value="0">0°</option>
<option value="0.785398164">45°</option>
<option value="1.570796327">90°</option>
</select>
<br />
<label for="points-font">Font: </label>
<select id="points-font">
<option value="Arial" selected="selected">Arial</option>
<option value="'Courier New'">Courier New</option>
<option value="'Open Sans'">Open Sans</option>
<option value="Verdana">Verdana</option>
</select>
<br />
<label for="points-weight">Weight: </label>
<select id="points-weight">
<option value="bold">Bold</option>
<option value="normal" selected="selected">Normal</option>
</select>
<br />
<label for="points-placement">Placement: </label>
<select disabled id="points-placement">
<option value="line">Line</option>
<option value="point" selected="selected">Point</option>
</select>
<br />
<label for="points-maxangle">Max Angle: </label>
<select disabled id="points-maxangle">
<option value="0.7853981633974483" selected="selected">45°</option>
<option value="2.0943951023931953">120°</option>
<option value="6.283185307179586">360°</option>
</select>
<br />
<label for="points-overflow">Exceed Len: </label>
<select disabled id="points-overflow">
<option value="true">True</option>
<option value="false" selected="selected">False</option>
</select>
<br />
<label for="points-size">Size: </label>
<input type="text" value="12px" id="points-size" />
<br />
<label for="points-height">Line height: </label>
<input type="text" value="1" id="points-height" />
<br />
<label for="points-offset-x">Offset X: </label>
<input type="text" value="0" id="points-offset-x" />
<br />
<label for="points-offset-y">Offset Y: </label>
<input type="text" value="0" id="points-offset-y" />
<br />
<label for="points-color">Color: </label>
<input type="text" value="#aa3300" id="points-color" />
<br />
<label for="points-outline" title="Outline Color">O. Color: </label>
<input type="text" value="#ffffff" id="points-outline" />
<br />
<label for="points-outline-width" title="Outline Width">O. Width: </label>
<input type="text" value="3" id="points-outline-width" />
</div>
</div>
<div class="edit-form">
<input id="refresh-lines" type="button" value="Refresh" />
<h2>Lines</h2>
<div class="edit-form-elem">
<label for="lines-text">Text: </label>
<select id="lines-text">
<option value="hide">Hide</option>
<option value="normal">Normal</option>
<option value="shorten">Shorten</option>
<option value="wrap" selected="selected">Wrap</option>
</select>
<br />
<label for="lines-maxreso" title="Max Resolution Denominator">MaxReso.: </label>
<select id="lines-maxreso">
<option value="38400">38,400</option>
<option value="19200">19,200</option>
<option value="9600">9,600</option>
<option value="4800">4,800</option>
<option value="2400">2,400</option>
<option value="1200" selected="selected">1,200</option>
<option value="600">600</option>
<option value="300">300</option>
<option value="150">150</option>
<option value="75">75</option>
<option value="32">32</option>
<option value="16">16</option>
<option value="8">8</option>
</select>
<br />
<label for="lines-align">Align: </label>
<select id="lines-align">
<option value="" selected="selected"></option>
<option value="center">Center</option>
<option value="end">End</option>
<option value="left">Left</option>
<option value="right">Right</option>
<option value="start">Start</option>
</select>
<br />
<label for="lines-baseline">Baseline: </label>
<select id="lines-baseline">
<option value="alphabetic">Alphabetic</option>
<option value="bottom">Bottom</option>
<option value="hanging">Hanging</option>
<option value="ideographic">Ideographic</option>
<option value="middle" selected="selected">Middle</option>
<option value="top">Top</option>
</select>
<br />
<label for="lines-rotation">Rotation: </label>
<select id="lines-rotation">
<option value="0">0°</option>
<option value="0.785398164">45°</option>
<option value="1.570796327">90°</option>
</select>
<br />
<label for="lines-font">Font: </label>
<select id="lines-font">
<option value="Arial">Arial</option>
<option value="'Courier New'" selected="selected">Courier New</option>
<option value="'Open Sans'">Open Sans</option>
<option value="Verdana">Verdana</option>
</select>
<br />
<label for="lines-weight">Weight: </label>
<select id="lines-weight">
<option value="bold" selected="selected">Bold</option>
<option value="normal">Normal</option>
</select>
<br />
<label for="lines-placement">Placement: </label>
<select id="lines-placement">
<option value="line">Line</option>
<option value="point" selected="selected">Point</option>
</select>
<br />
<label for="lines-maxangle">Max Angle: </label>
<select id="lines-maxangle">
<option value="0.7853981633974483" selected="selected">45°</option>
<option value="2.0943951023931953">120°</option>
<option value="6.283185307179586">360°</option>
</select>
<br />
<label for="lines-overflow">Exceed Len: </label>
<select id="lines-overflow">
<option value="true">True</option>
<option value="false" selected="selected">False</option>
</select>
<br />
<label for="lines-size">Size: </label>
<input type="text" value="12px" id="lines-size" />
<br />
<label for="lines-height">Line height: </label>
<input type="text" value="1.2" id="lines-height" />
<br />
<label for="lines-offset-x">Offset X: </label>
<input type="text" value="0" id="lines-offset-x" />
<br />
<label for="lines-offset-y">Offset Y: </label>
<input type="text" value="0" id="lines-offset-y" />
<br />
<label for="lines-color">Color: </label>
<input type="text" value="green" id="lines-color" />
<br />
<label for="lines-outline" title="Outline Color">O. Color: </label>
<input type="text" value="#ffffff" id="lines-outline" />
<br />
<label for="lines-outline-width" title="Outline Width">O. Width: </label>
<input type="text" value="3" id="lines-outline-width" />
</div>
</div>
<div class="edit-form">
<input id="refresh-polygons" type="button" value="Refresh" />
<h2>Polygons</h2>
<div class="edit-form-elem">
<label for="polygons-text">Text: </label>
<select id="polygons-text">
<option value="hide">Hide</option>
<option value="normal" selected="selected">Normal</option>
<option value="shorten">Shorten</option>
<option value="wrap">Wrap</option>
</select>
<br />
<label for="polygons-maxreso" title="Max Resolution Denominator">MaxReso.: </label>
<select id="polygons-maxreso">
<option value="38400">38,400</option>
<option value="19200">19,200</option>
<option value="9600">9,600</option>
<option value="4800">4,800</option>
<option value="2400">2,400</option>
<option value="1200" selected="selected">1,200</option>
<option value="600">600</option>
<option value="300">300</option>
<option value="150">150</option>
<option value="75">75</option>
<option value="32">32</option>
<option value="16">16</option>
<option value="8">8</option>
</select>
<br />
<label for="polygons-align">Align: </label>
<select id="polygons-align">
<option value="" selected="selected"></option>
<option value="center">Center</option>
<option value="end">End</option>
<option value="left">Left</option>
<option value="right">Right</option>
<option value="start">Start</option>
</select>
<br />
<label for="polygons-baseline">Baseline: </label>
<select id="polygons-baseline">
<option value="alphabetic">Alphabetic</option>
<option value="bottom">Bottom</option>
<option value="hanging">Hanging</option>
<option value="ideographic">Ideographic</option>
<option value="middle" selected="selected">Middle</option>
<option value="top">Top</option>
</select>
<br />
<label for="polygons-rotation">Rotation: </label>
<select id="polygons-rotation">
<option value="0">0°</option>
<option value="0.785398164">45°</option>
<option value="1.570796327">90°</option>
</select>
<br />
<label for="polygons-font">Font: </label>
<select id="polygons-font">
<option value="Arial">Arial</option>
<option value="'Courier New'">Courier New</option>
<option value="'Open Sans'">Open Sans</option>
<option value="Verdana" selected="selected">Verdana</option>
</select>
<br />
<label for="polygons-weight">Weight: </label>
<select id="polygons-weight">
<option value="bold" selected="selected">Bold</option>
<option value="normal">Normal</option>
</select>
<br />
<label for="polygons-placement">Placement: </label>
<select id="polygons-placement">
<option value="line">Line</option>
<option value="point" selected="selected">Point</option>
</select>
<br />
<label for="polygons-maxangle">Max Angle: </label>
<select id="polygons-maxangle">
<option value="0.7853981633974483" selected="selected">45°</option>
<option value="2.0943951023931953">120°</option>
<option value="6.283185307179586">360°</option>
</select>
<br />
<label for="polygons-overflow">Exceed Len: </label>
<select id="polygons-overflow">
<option value="true">True</option>
<option value="false" selected="selected">False</option>
</select>
<br />
<label for="polygons-size">Size: </label>
<input type="text" value="10px" id="polygons-size" />
<br />
<label for="polygons-height">Line height: </label>
<input type="text" value="1" id="polygons-height" />
<br />
<label for="polygons-offset-x">Offset X: </label>
<input type="text" value="0" id="polygons-offset-x" />
<br />
<label for="polygons-offset-y">Offset Y: </label>
<input type="text" value="0" id="polygons-offset-y" />
<br />
<label for="polygons-color">Color: </label>
<input type="text" value="blue" id="polygons-color" />
<br />
<label for="polygons-outline" title="Outline Color">O. Color: </label>
<input type="text" value="#ffffff" id="polygons-outline" />
<br />
<label for="polygons-outline-width" title="Outline Width">O. Width: </label>
<input type="text" value="3" id="polygons-outline-width" />
</div>
</div>
<script src="main.js"></script>
</body>
</html>
package.json
{
"name": "vector-labels",
"dependencies": {
"ol": "7.1.0"
},
"devDependencies": {
"parcel": "^2.0.0-beta.1"
},
"scripts": {
"start": "parcel index.html",
"build": "parcel build --public-url . index.html"
}
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论