File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 44 < meta charset ="UTF-8 ">
55 < title data-i18n ="resources.title_mvtVectorLayer4326 "> </ title >
66 < script type ="text/javascript " src ="../js/include-web.js "> </ script >
7- < script type ="text/javascript " src ="../../dist/include-openlayers.js "> </ script >
7+ <!--<script type="text/javascript" src="../../dist/include-openlayers.js"></script>-->
8+ < script type ="text/javascript " src ="http://openlayers.org/en/latest/css/ol.css "> </ script >
9+ <!--当前示例使用 ol-debug 原因:ol.format.MVT 默认坐标系为 3857,最新代码未更新该默认设置,需使用ol-debug,设置 defaultDataProjection 参数,以支持4326底图-->
10+ < script type ="text/javascript " src ="http://openlayers.org/en/latest/build/ol-debug.js "> </ script >
11+ < script type ="text/javascript " src ="../../dist/iclient9-openlayers.js "> </ script >
812</ head >
913< body style =" margin: 0;overflow: hidden;background: #fff;width: 100%;height:100% ">
1014< div id ="map " style ="margin:0 auto;width: 100%;height: 100%;border: 1px solid #dddddd "> </ div >
2731 }
2832 var vectorTileStyles = new ol . supermap . VectorTileStyles ( stylesOptions ) ;
2933 var vectorTileOptions = ol . source . VectorTileSuperMapRest . optionsFromMapJSON ( url , serviceResult . result ) ;
34+ vectorTileOptions . format = new ol . format . MVT ( { featureClass : ol . Feature } ) ;
35+ vectorTileOptions . format . defaultDataProjection = new ol . proj . Projection ( {
36+ code : 'EPSG:4326' ,
37+ units : ol . proj . Units . TILE_PIXELS
38+ } ) ;
3039 var vectorLayer = new ol . layer . VectorTile ( {
3140 //设置避让参数
3241 declutter : true ,
You can’t perform that action at this time.
0 commit comments