标签:round target new styles oct log type php source
php请求MySQL数据库返回GeoJSON数据的实现方法请参见:
http://www.cnblogs.com/marost/p/6234514.html
OpenLayers【v3.19.1-dist】添加GeoJSON数据源图层
<!doctype html> <html lang="en"> <head> <link rel=‘stylesheet‘ href=‘ol.css‘> <style> #map { height: 100%; width: 100%; } </style> <title>OpenLayers 3 example</title> <script src="ol.js" type="text/javascript"></script> </head> <body> <h1>My Map</h1> <div id="map"></div> <script type="text/javascript"> var raster = new ol.layer.Tile({ source: new ol.source.OSM() }); var vector = new ol.layer.Vector({ source: new ol.source.Vector({ url: ‘http://yourip/getPosition.php‘, format: new ol.format.GeoJSON() }) }); var map = new ol.Map({ layers: [raster, vector], target: ‘map‘, view: new ol.View({ center: [0, 0], zoom: 2 }) }); </script> </body> </html>
OpenLayers添加点【php请求MySQL数据库返回GeoJSON数据】
标签:round target new styles oct log type php source
原文地址:http://www.cnblogs.com/marost/p/6235379.html