图解OpenLayers-2.13.1入门实例
生活随笔
收集整理的這篇文章主要介紹了
图解OpenLayers-2.13.1入门实例
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
1 下載
http://www.openlayers.cn/forum.php?mod=viewthread&tid=171
解壓后有如下內容;
2 實例1
把img, theme 文件夾,OpenLayers.js,拷貝到一個新建文件夾,并新建index.html;
index.html:
<!DOCTYPE html><html lang='zh-cn'><head><meta charset='utf-8' /><title>My OpenLayers Map</title><script type='text/javascript' src='OpenLayers.js'></script><script type='text/javascript'>var map;function init() {map = new OpenLayers.Map('map', {});var wms = new OpenLayers.Layer.WMS('OpenLayers WMS','http://vmap0.tiles.osgeo.org/wms/vmap3',{layers: 'basic'},{});map.addLayer(wms);if (!map.getCenter()) {map.zoomToMaxExtent();}}</script></head><body οnlοad='init();'><div id='map' style='width: 800px; height: 600px;'></div></body></html>效果;
3 實例2
index2.html
<!DOCTYPE html><html lang='zh-cn'><head><meta charset='utf-8' /><title>My OpenLayers Map</title><script type='text/javascript' src='OpenLayers.js'></script><script type='text/javascript'>var map;function init() {map = new OpenLayers.Map('map', {});var wms = new OpenLayers.Layer.WMS('OpenLayers WMS','http://vmap0.tiles.osgeo.org/wms/vmap3',{layers: 'basic'},{});map.addLayer(wms);if (!map.getCenter()) {map.zoomToMaxExtent();}}</script></head><body οnlοad='init();'><div id='map' style='width: 800px; height: 600px;'></div></body></html>效果;
4 鏈接
http://openlayers.org/en/v3.5.0/examples/
openlayer官方例子;
http://www.openlayers.cn/portal.php
openlayer中文網
http://www.cnblogs.com/kaituorensheng/p/4526149.html
http://blog.csdn.net/linlzk/article/details/17354093
http://www.cnblogs.com/nianming/archive/2012/07/19/2600272.html
總結
以上是生活随笔為你收集整理的图解OpenLayers-2.13.1入门实例的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 图解http协议头实例分析
- 下一篇: 3d数学基础学习总结