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

surface highlighted from JS API can have lineWeight, lineOpacity, lineColor properties

parent 6faed7b1
No related branches found
No related tags found
1 merge request!22surface highlighted from JS API can have lineWeight, lineOpacity, lineColor properties
......@@ -176,12 +176,26 @@ IdentifiedElement.prototype.setOpacity = function(opacity) {
this._visualizationdata._opacity = opacity;
};
IdentifiedElement.prototype.getLineWidth = function() {
return this._visualizationdata._lineWidth;
IdentifiedElement.prototype.getLineWeight = function() {
return this._visualizationdata._lineWeight;
};
IdentifiedElement.prototype.setLineWidth = function(lineWidth) {
this._visualizationdata._lineWidth = lineWidth;
IdentifiedElement.prototype.setLineWeight = function(lineWeight) {
this._visualizationdata._lineWeight = lineWeight;
};
IdentifiedElement.prototype.getLineOpacity = function() {
return this._visualizationdata._lineOpacity;
};
IdentifiedElement.prototype.setLineOpacity = function(lineOpacity) {
this._visualizationdata._lineOpacity = lineOpacity;
};
IdentifiedElement.prototype.getLineColor = function() {
return this._visualizationdata._lineColor;
};
IdentifiedElement.prototype.setLineColor = function(lineColor) {
this._visualizationdata._lineColor = lineColor;
};
IdentifiedElement.prototype.getOnClickHandler = function() {
......
......@@ -141,12 +141,28 @@ AliasOverlay.createFromIdentifiedElement = function(element, map) {
if (element.getOpacity() !== undefined) {
fillOpacity = element.getOpacity();
}
var strokeWeight = 1;
if (element.getLineWeight() !== undefined) {
strokeWeight = element.getLineWeight();
}
var strokeColor = "#000000";
if (element.getLineColor() !== undefined) {
strokeColor = element.getLineColor();
}
var strokeOpacity = 1;
if (element.getLineOpacity() !== undefined) {
strokeOpacity = element.getLineOpacity();
}
var rectangle = new google.maps.Rectangle({
fillOpacity : fillOpacity,
strokeWeight : 1,
map : map.getGoogleMap(),
bounds : bounds,
fillColor : color
fillOpacity : fillOpacity,
fillColor : color,
strokeColor : strokeColor,
strokeOpacity : strokeOpacity,
strokeWeight : strokeWeight,
});
return new AliasOverlay(rectangle, map, alias);
......
......@@ -49,9 +49,7 @@ UserDbOverlay.prototype.addMarker = function(params) {
for (i = 0; i < params.length; i++) {
var singleElementParam = params[i];
element = new IdentifiedElement(singleElementParam.element);
if (singleElementParam.icon !== undefined) {
element.setIcon(singleElementParam.icon);
}
element.setIcon(singleElementParam.icon);
if (self._markerIdentifiedElements[element.getType()][element.getId()] !== undefined) {
self.enableAddRemoveElements();
return Promise.reject(new Error("Element already highlighted: " + element.getId()));
......@@ -87,6 +85,9 @@ UserDbOverlay.prototype.addSurface = function(params) {
if (singleElementParam.options !== undefined) {
element.setColor(singleElementParam.options.color);
element.setOpacity(singleElementParam.options.opacity);
element.setLineColor(singleElementParam.options.lineColor);
element.setLineWeight(singleElementParam.options.lineWeight);
element.setLineOpacity(singleElementParam.options.lineOpacity);
}
if (self._surfaceIdentifiedElements[element.getType()][element.getId()] !== undefined) {
self.enableAddRemoveElements();
......
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