@@ -2,7 +2,7 @@ require('../../../src/openlayers/core/StyleUtils.js');
22require ( '../../tool/china_cartoCSS.js' ) ;
33require ( '../../tool/china_layers.js' ) ;
44require ( '../../tool/iPortal_maps.js' ) ;
5- var fetchJsonp = require ( 'fetch-jsonp ' ) ;
5+ var fetch = require ( 'whatwg- fetch-importable ' ) ;
66
77var StyleUtils = ol . supermap . StyleUtils ;
88var layersInfo , cartoCSSShaders , iPortalLayersInfo ;
@@ -24,7 +24,7 @@ describe('openlayers_testStyleUtils', function () {
2424
2525 //测试从图层信息中获取style
2626 it ( 'getValidStyleFromLayerInfo_point' , function ( done ) {
27- var tileFeatureUrl = mapUrl + "/tileFeature.jsonp ?returnAttributes=true&x=420&y=195&width=256&height=256&scale=8.653637486605572e-7" ;
27+ var tileFeatureUrl = mapUrl + "/tileFeature.json ?returnAttributes=true&x=420&y=195&width=256&height=256&scale=8.653637486605572e-7" ;
2828 var request = requestFeature ( tileFeatureUrl ) ;
2929 request . then ( function ( features ) {
3030 try {
@@ -55,7 +55,7 @@ describe('openlayers_testStyleUtils', function () {
5555
5656 //测试从图层信息中获取style
5757 it ( 'getValidStyleFromLayerInfo_polyLine' , function ( done ) {
58- var tileFeatureUrl = mapUrl + "/tileFeature.jsonp ?returnAttributes=true&x=420&y=193&width=256&height=256&scale=8.653637486605572e-7" ;
58+ var tileFeatureUrl = mapUrl + "/tileFeature.json ?returnAttributes=true&x=420&y=193&width=256&height=256&scale=8.653637486605572e-7" ;
5959 var request = requestFeature ( tileFeatureUrl ) ;
6060 request . then ( function ( features ) {
6161 try {
@@ -85,7 +85,7 @@ describe('openlayers_testStyleUtils', function () {
8585
8686 //测试从图层信息中获取style
8787 it ( 'getValidStyleFromLayerInfo_polygon' , function ( done ) {
88- var tileFeatureUrl = mapUrl + "/tileFeature.jsonp ?returnAttributes=true&x=1686&y=775&width=256&height=256&scale=0.00000346145499464224" ;
88+ var tileFeatureUrl = mapUrl + "/tileFeature.json ?returnAttributes=true&x=1686&y=775&width=256&height=256&scale=0.00000346145499464224" ;
8989 var request = requestFeature ( tileFeatureUrl ) ;
9090 request . then ( function ( features ) {
9191 try {
@@ -119,7 +119,7 @@ describe('openlayers_testStyleUtils', function () {
119119
120120 //测试从图层信息中获取style
121121 it ( 'getValidStyleFromLayerInfo_text1' , function ( done ) {
122- var tileFeatureUrl = mapUrl + "/tileFeature.jsonp ?returnAttributes=true&x=1689&y=775&width=256&height=256&scale=0.00000346145499464224" ;
122+ var tileFeatureUrl = mapUrl + "/tileFeature.json ?returnAttributes=true&x=1689&y=775&width=256&height=256&scale=0.00000346145499464224" ;
123123 var request = requestFeature ( tileFeatureUrl ) ;
124124 request . then ( function ( features ) {
125125 try {
@@ -148,7 +148,7 @@ describe('openlayers_testStyleUtils', function () {
148148
149149 //测试从图层信息中获取style
150150 it ( 'getValidStyleFromLayerInfo_text2' , function ( done ) {
151- var tileFeatureUrl = mapUrl + "/tileFeature.jsonp ?returnAttributes=true&x=28&y=13&width=256&height=256&scale=5.408523429128511e-8" ;
151+ var tileFeatureUrl = mapUrl + "/tileFeature.json ?returnAttributes=true&x=28&y=13&width=256&height=256&scale=5.408523429128511e-8" ;
152152 var request = requestFeature ( tileFeatureUrl ) ;
153153 request . then ( function ( features ) {
154154 try {
@@ -178,7 +178,7 @@ describe('openlayers_testStyleUtils', function () {
178178
179179 //测试从CartoCSS中获取style
180180 it ( 'getStyleFromCarto_point1' , function ( done ) {
181- var tileFeatureUrl = mapUrl + "/tileFeature.jsonp ?returnAttributes=true&x=420&y=195&width=256&height=256&scale=8.653637486605572e-7" ;
181+ var tileFeatureUrl = mapUrl + "/tileFeature.json ?returnAttributes=true&x=420&y=195&width=256&height=256&scale=8.653637486605572e-7" ;
182182 var request = requestFeature ( tileFeatureUrl ) ;
183183 request . then ( function ( features ) {
184184 try {
@@ -209,7 +209,7 @@ describe('openlayers_testStyleUtils', function () {
209209
210210 //测试从CartoCSS中获取style
211211 it ( 'getStyleFromCarto_point2' , function ( done ) {
212- var tileFeatureUrl = mapUrl + "/tileFeature.jsonp ?returnAttributes=true&x=1687&y=774&width=256&height=256&scale=0.00000346145499464224" ;
212+ var tileFeatureUrl = mapUrl + "/tileFeature.json ?returnAttributes=true&x=1687&y=774&width=256&height=256&scale=0.00000346145499464224" ;
213213 var request = requestFeature ( tileFeatureUrl ) ;
214214 request . then ( function ( features ) {
215215 try {
@@ -239,7 +239,7 @@ describe('openlayers_testStyleUtils', function () {
239239
240240 //测试从CartoCSS中获取style
241241 it ( 'getStyleFromCarto_polyLine' , function ( done ) {
242- var tileFeatureUrl = mapUrl + "/tileFeature.jsonp ?returnAttributes=true&x=420&y=193&width=256&height=256&scale=8.653637486605572e-7" ;
242+ var tileFeatureUrl = mapUrl + "/tileFeature.json ?returnAttributes=true&x=420&y=193&width=256&height=256&scale=8.653637486605572e-7" ;
243243 var request = requestFeature ( tileFeatureUrl ) ;
244244 request . then ( function ( features ) {
245245 try {
@@ -269,7 +269,7 @@ describe('openlayers_testStyleUtils', function () {
269269
270270 //测试从CartoCSS中获取style
271271 it ( 'getStyleFromCarto_polygon' , function ( done ) {
272- var tileFeatureUrl = mapUrl + "/tileFeature.jsonp ?returnAttributes=true&x=1686&y=775&width=256&height=256&scale=0.00000346145499464224" ;
272+ var tileFeatureUrl = mapUrl + "/tileFeature.json ?returnAttributes=true&x=1686&y=775&width=256&height=256&scale=0.00000346145499464224" ;
273273 var request = requestFeature ( tileFeatureUrl ) ;
274274 request . then ( function ( features ) {
275275 try {
@@ -300,7 +300,7 @@ describe('openlayers_testStyleUtils', function () {
300300
301301 //测试从CartoCSS中获取style
302302 it ( 'getStyleFromCarto_text' , function ( done ) {
303- var tileFeatureUrl = mapUrl + "/tileFeature.jsonp ?returnAttributes=true&x=1689&y=775&width=256&height=256&scale=0.00000346145499464224" ;
303+ var tileFeatureUrl = mapUrl + "/tileFeature.json ?returnAttributes=true&x=1689&y=775&width=256&height=256&scale=0.00000346145499464224" ;
304304 var request = requestFeature ( tileFeatureUrl ) ;
305305 request . then ( function ( features ) {
306306 try {
@@ -505,7 +505,7 @@ function getShader(layerName) {
505505function requestFeature ( url ) {
506506 var tileFormat = new ol . format . GeoJSON ( ) ;
507507
508- return fetchJsonp ( url , { method : 'GET' , timeout : 10000 } )
508+ return fetch ( url , { method : 'GET' , timeout : 10000 } )
509509 . then ( function ( response ) {
510510 return response . json ( ) ;
511511 } ) . then ( function ( tileFeatureJson ) {
0 commit comments