Skip to content

加载矢量瓦片报错 #57

@luo-geng

Description

@luo-geng

Request a feature or report a bug? [这是一个需求还是一个缺陷]

缺陷

One-line summary [问题简述]

加载矢量瓦片报错

Version [产品及版本]

  • iClient product (for leaflet,for openlayers,for mapboxgl,classic)[iClient 产品]: iclient-openlayers
  • iClient version [iClient 版本]:v10.0.0
  • Browser version [浏览器类型和版本]:谷歌78
  • OS Version [操作系统类型和版本]:win10

Actual Behavior [当前现象]

iclient-openlayers-es6.js:89071 Uncaught TypeError: Cannot read property 'applyBackground' of undefined
    at MapboxStyles_MapboxStyles._createStyleFunction (iclient-openlayers-es6.js:89071)
    at MapboxStyles_MapboxStyles._initStyleFunction (iclient-openlayers-es6.js:89062)
    at Image.img.onload (iclient-openlayers-es6.js:89044)

Expected Behavior [期望现象]

矢量瓦片可以加载

Example of reproducing the issue [重现现象的例子]

在本地

	var style_url = "http://47.104.186.12:8090/iserver/services/map-mvt-ZiShuiTu/restjsr/v1/vectortile/maps/渍水图/style.json"
	var format = new ol.format.MVT({
		featureClass: ol.Feature

	});
	var style = new ol.supermap.MapboxStyles({
		style: style_url,
		map: map
	})
	style.on('styleloaded', function () {
		console.log(style)
		var layer_risk = new ol.layer.VectorTile({
			declutter: true,
			source: new ol.source.VectorTileSuperMapRest({
				// url,
				style: style_url,
				projection: 'EPSG:3857',
				format: format
			}),
			style: style.getStyleFunction()
		});
		console.log(layer_risk)
		map.addLayer(layer_risk);
		layer_risk.setVisible(false);
	})
在官方demo加上请求的矢量瓦片

微信截图_20191114182747


在iserver可以浏览
微信截图_20191114182724

What is motivation or use case for changing the behavior? [需求的场景和目的是什么?]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy