zoukankan      html  css  js  c++  java
  • OpenLayers添加点【php请求MySQL数据库返回GeoJSON数据】

    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>
  • 相关阅读:
    最短路径问题/Spfa
    cddiv/数组维护
    cfdiv2/c/找规律
    Codeforces Round #343 (Div. 2)【A,B水题】
    POJ 2135_Farm Tour
    POJ 3469_Dual Core CPU
    POJ 3469_Dual Core CPU
    POJ 3281_Dining
    POJ 3281_Dining
    POJ 3041_Asteroids
  • 原文地址:https://www.cnblogs.com/marost/p/6235379.html
Copyright © 2011-2022 走看看