【发布时间】:2016-12-20 00:17:38
【问题描述】:
我想在网站上显示“德国”地图及其边界。 使用 Windows 10 和 Firefox 一切正常,但在 Mac OS 和 iPhone 下 layer.vector 没有显示。有什么想法吗?
<script>
var fill = new ol.style.Fill({
color: 'rgba(30,144,255,0.2)'
});
var stroke = new ol.style.Stroke({
color: '#1E90FF',
width: 2
});
var style = new ol.style.Style({
fill: fill,
stroke: stroke
});
var vectorLayer = new ol.layer.Vector({
source: new ol.source.Vector({
url: '[URL TO JSON]',
format: new ol.format.GeoJSON()
}),
style: style
});
var map = new ol.Map({
layers: [
new ol.layer.Tile({
source: new ol.source.OSM()
}),
vectorLayer
],
target: 'map',
view: new ol.View({
center: ol.proj.fromLonLat([5.9688, 51.0852]),
zoom: 5
})
});
顶部:Windows 10 + Firefox
底部:Mac OS + Firefox/Safari
【问题讨论】:
-
不知道?没有人? ://
-
在 Mac 上使用 Safari 时,Web 浏览器中的控制台显示什么?我的猜测是您遇到了其他浏览器都可以使用的错误。
标签: javascript macos openlayers-3