From 25c4d0af5d09822be1eef96a25c03c9b8d99f5f6 Mon Sep 17 00:00:00 2001 From: cehui0303 Date: Fri, 19 Apr 2019 13:35:17 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E4=B8=8D=E5=88=B0Style=E5=92=8C=E6=98=BE=E7=A4=BA=E7=9F=A2?= =?UTF-8?q?=E9=87=8F=E5=88=87=E7=89=87=E5=9B=BE=E5=B1=82=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/main.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/js/main.js b/js/main.js index fc8c190..72c4ae7 100644 --- a/js/main.js +++ b/js/main.js @@ -936,7 +936,7 @@ define([ // GET STYLE // esriRequest({ - url: lang.replace("{itemUrl}/resources/styles/root.json", this.selectedItem), + url: lang.replace("{url}/resources/styles/root.json", this.selectedItem), content: { f: "json" } }).then(function (style) { console.info("root.json", style); @@ -951,7 +951,8 @@ define([ // VECTOR BASEMAP LAYER // // - THERE ARE SEVERAL WAYS TO CREATE VECTORTILELAYER... // HERE WE PASS IN THE STYLE DIRECTLY INTO THE CONSTRUCTOR - this.vectorBasemapLayer = new VectorTileLayer(this._cloneVectorTileLayerStyle(style)); + //this.vectorBasemapLayer = new VectorTileLayer(this._cloneVectorTileLayerStyle(style)); + this.vectorBasemapLayer = new VectorTileLayer(lang.replace("{url}/resources/styles/root.json", this.selectedItem)); this.vectorBasemapLayer.on("error", function (evt) { console.warn("vectorBasemapLayer.error: ", evt.error); }.bind(this)); From ac7355137fc5c24909a5b1ce6a61ca2ea2ff4bcd Mon Sep 17 00:00:00 2001 From: cehui0303 Date: Fri, 19 Apr 2019 15:16:16 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E5=B0=86style=E7=9A=84url=E8=B7=AF?= =?UTF-8?q?=E5=BE=84=E9=85=8D=E7=BD=AE=E4=B8=BA=E7=BB=9D=E5=AF=B9=E8=B7=AF?= =?UTF-8?q?=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/main.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/js/main.js b/js/main.js index 72c4ae7..2653bb1 100644 --- a/js/main.js +++ b/js/main.js @@ -941,18 +941,26 @@ define([ }).then(function (style) { console.info("root.json", style); + + //需要把style里的url处理为绝对路径 + //..... + style.sources.esri.url = this.selectedItem.url; + style.sprite = this.selectedItem.url + "/resources/sprites/sprite"; + style.glyphs = this.selectedItem.url + "/resources/fonts/{fontstack}/{range}.pbf"; var isSecure = /https:/i; if(isSecure.test(window.location.protocol)) { style.glyphs = style.glyphs.replace(/http:/gi, "https:"); style.sprite = style.sprite.replace(/http:/gi, "https:"); style.sources.esri.url = style.sources.esri.url.replace(/http:/gi, "https:"); - } + } + + // VECTOR BASEMAP LAYER // // - THERE ARE SEVERAL WAYS TO CREATE VECTORTILELAYER... // HERE WE PASS IN THE STYLE DIRECTLY INTO THE CONSTRUCTOR - //this.vectorBasemapLayer = new VectorTileLayer(this._cloneVectorTileLayerStyle(style)); - this.vectorBasemapLayer = new VectorTileLayer(lang.replace("{url}/resources/styles/root.json", this.selectedItem)); + this.vectorBasemapLayer = new VectorTileLayer(this._cloneVectorTileLayerStyle(style)); + //this.vectorBasemapLayer = new VectorTileLayer(lang.replace("{url}/resources/styles/root.json", this.selectedItem)); this.vectorBasemapLayer.on("error", function (evt) { console.warn("vectorBasemapLayer.error: ", evt.error); }.bind(this)); From 97b630603c6b5b99c895dfeb459f63448f5aca41 Mon Sep 17 00:00:00 2001 From: cehui0303 <450380306@qq.com> Date: Fri, 19 Apr 2019 15:20:21 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E6=9B=B4=E6=96=B0Update.md=E8=AF=B4?= =?UTF-8?q?=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ArcGIS Javascript API对SetStyle的一些说明 --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index e60bbef..3157e21 100644 --- a/README.md +++ b/README.md @@ -34,3 +34,8 @@ Edit the styles of Esri Vector Basemaps via ArcGIS.com items > WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > See the License for the specific language governing permissions and > limitations under the License. + +### 关于SetStyle错误的问题 +- https://developers.arcgis.com/javascript/3/jsapi/vectortilelayer-amd.html#setstyle + +- Changes the style properties used to render the layers. It is the equivalent of changing the entire CSS style sheet for a web page. It takes either a style object or a url to a style resource. When loading a style, it is the developer's responsibility to make sure that any relative urls in the style resolve correctly.(要由开发者对url路径进行处理!!!) From 45c11448d886fc7d59c8a3635f1bc872d3ad9c6b Mon Sep 17 00:00:00 2001 From: cehui0303 Date: Tue, 11 Jun 2019 16:22:39 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E6=B7=BB=E5=8A=A0oauth=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- oauth.html | 164 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 164 insertions(+) create mode 100644 oauth.html diff --git a/oauth.html b/oauth.html new file mode 100644 index 0000000..3cff162 --- /dev/null +++ b/oauth.html @@ -0,0 +1,164 @@ + + + + + 测试ArcGIS OAuth功能 + + + + + + + + + + + + + \ No newline at end of file