@(笔记)[OpenLayers]@案例:https://github.com/lhywell/map/tree/master/example/example15
可以嵌入OSM、ArcGic等很多种地图源,开源的javascript库
git:https://github.com/openlayers/openlayers
- 高性能
- 支持OSM,Bing,MapBox,Stamen等多种瓦片
- 渲染GeoJSON, TopoJSON, KML, GML, Mapbox vector tiles,矢量数据
- 支持各种插件库
- 移动优先
图层是用包含一个源的类型(Image,Tile或Vector)定义的
允许指定地图的中心,分辨率和旋转。
- JavaScript API http://openlayers.org/en/latest/apidoc/
http://openlayers.org/en/latest/examples/
<!doctype html>
<html lang="en">
<head>
<link rel="stylesheet" href="https://openlayers.org/en/v4.6.4/css/ol.css" type="text/css">
<style>
.map {
height: 400px;
width: 100%;
}
</style>
<script src="https://openlayers.org/en/v4.6.4/build/ol.js" type="text/javascript"></script>
<title>OpenLayers example</title>
</head>
<body>
<h2>My Map</h2>
<div id="map" class="map"></div>
<script type="text/javascript">
var map = new ol.Map({
target: 'map',
layers: [
new ol.layer.Tile({
source: new ol.source.OSM()
})
],
view: new ol.View({
center: ol.proj.fromLonLat([116.404, 39.915]),
zoom: 12
})
});
</script>
</body>
</html>
上一页:Leaflet.js
下一页:TURF