我正在使用angular-leaflet-directive。有沒有更改圖層不透明度的選項?Angular-Leaflet-Directive:設置圖層的不透明度
使用'常規'傳單我可以使用layer.setOpacity(0.5)
。但是在角單張指令中似乎沒有選擇。
編輯: 這裏是我的傳單配置:
angular.module('epic-taxi')
.controller('MainController', ['$scope', function($scope) {
$scope.initMap = function() {
angular.extend($scope, {
newYork: {
lat: 40.7304783951045,
lng: -73.98880004882812,
zoom: 12
},
layers: {
baselayers: {
mapbox_light: {
name: 'Light',
type: 'xyz',
url: 'http://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png'
}
},
overlays: {
subway: {
name: 'Subway',
visible: true,
type: 'group',
opacity: 0.1 // not working
}
}
}
});
};
}]);
我想換一個包含多個路徑的「地鐵」疊加的不透明度。
那如何解決我的問題?我想改變一個特定圖層的不透明度。 – fwind
創建特定圖層時...使用此屬性 - 「不透明度」。如果您需要更多幫助,請發佈部分代碼。 –
不透明屬性似乎什麼都不做。我添加了我的地圖初始化。我想改變包含多條路徑的'地鐵'疊加層的不透明度。 – fwind