Skip to content
Snippets Groups Projects
Commit fa70e975 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

allow user to set opacity

parent bd24614c
No related branches found
No related tags found
1 merge request!12Resolve "new JS API calls"
......@@ -168,6 +168,14 @@ IdentifiedElement.prototype.setColor = function(color) {
this._visualizationdata._color = color;
};
IdentifiedElement.prototype.getOpacity = function() {
return this._visualizationdata._opacity;
};
IdentifiedElement.prototype.setOpacity = function(opacity) {
this._visualizationdata._opacity = opacity;
};
IdentifiedElement.prototype.getLineWidth = function() {
return this._visualizationdata._lineWidth;
};
......
......@@ -137,8 +137,12 @@ AliasOverlay.createFromIdentifiedElement = function(element, map) {
if (element.getColor() !== undefined) {
color = element.getColor();
}
var fillOpacity = 0.8;
if (element.getOpacity() !== undefined) {
fillOpacity = element.getOpacity();
}
var rectangle = new google.maps.Rectangle({
fillOpacity : 0.8,
fillOpacity : fillOpacity,
strokeWeight : 1,
map : map.getGoogleMap(),
bounds : bounds,
......
......@@ -81,6 +81,7 @@ UserDbOverlay.prototype.addSurface = function(params) {
element = new IdentifiedElement(singleElementParam.element);
if (singleElementParam.options !== undefined) {
element.setColor(singleElementParam.options.color);
element.setOpacity(singleElementParam.options.opacity);
}
if (self._surfaceIdentifiedElements[element.getType()][element.getId()] !== undefined) {
return Promise.reject(new Error("Element already highlighted: " + element.getId()));
......
......@@ -292,7 +292,8 @@ function createResult(customMap) {
type : type,
options : {
icon : identifiedElements[i].getIcon(),
color : identifiedElements[i].getColor()
color : identifiedElements[i].getColor(),
opacity : identifiedElements[i].getOpacity(),
}
}
result.push(row);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment