| | |
| | | tiles: [ |
| | | // 获取GeoServer 矢量切片服务,可以是一下几种方式 |
| | | 'http://localhost:8080/vector/tile/{z}/{x}/{y}' // postgis 数据库 |
| | | // "http://xearth.cn:6213/geoserver/gwc/service/tms/1.0.0/vectory_tile%3Acontrolpoint@EPSG%3A4326@pbf/{z}/{x}/{y}.pbf" //geoserver |
| | | // 'http://xearth.cn:6213/geoserver/gwc/service/tms/1.0.0/vectory_tile%3Acontrolpoint@EPSG%3A4326@pbf/{z}/{x}/{y}.pbf' // geoserver |
| | | ] |
| | | } |
| | | var geojson = { |
| | |
| | | type: 'circle', |
| | | source: 'test', |
| | | 'source-layer': 'points', |
| | | // "source-layer": "controlpoint", |
| | | // 'source-layer': 'controlpoint', |
| | | minzoom: 0, |
| | | maxzoom: 18, |
| | | // "paint": { |
| | |
| | | ] |
| | | }, |
| | | 'circle-color': { |
| | | // property: 'v', |
| | | // property: 'measattribute', |
| | | stops: [ |
| | | [1, '#990055'], |
| | | [2, '#cdb640'] |
| | |
| | | ) |
| | | // 添加导航控件,控件的位置包括'top-left', 'top-right','bottom-left' ,'bottom-right'四种,默认为'top-right' |
| | | map.addControl(nav, 'top-left') |
| | | map.on('click', function (e) { |
| | | // map.on('click', function (e) { |
| | | // console.log(e) |
| | | // }) |
| | | map.on('click', 'test', function (e) { |
| | | if (e.defaultPrevented) { |
| | | return |
| | | } |
| | | e.preventDefault() |
| | | console.log(e) |
| | | console.log(e.features) |
| | | }) |
| | | console.log(geojson) |
| | | } |