Commit 25d297cf authored by Piotr Gawron's avatar Piotr Gawron
Browse files

rename AbstractOverlayElement -> AbstractSurfaceElement to match file name

parent 0072ee4a
......@@ -8,7 +8,7 @@ var ObjectWithListeners = require('../../ObjectWithListeners');
* Class representing abstract overlay element on the map relevant for a
* specific layout.
*/
function AbstractOverlayElement(params) {
function AbstractSurfaceElement(params) {
var self = this;
// call super constructor
ObjectWithListeners.call(this);
......@@ -31,16 +31,16 @@ function AbstractOverlayElement(params) {
}
}
AbstractOverlayElement.prototype = Object.create(ObjectWithListeners.prototype);
AbstractOverlayElement.prototype.constructor = AbstractOverlayElement;
AbstractSurfaceElement.prototype = Object.create(ObjectWithListeners.prototype);
AbstractSurfaceElement.prototype.constructor = AbstractSurfaceElement;
AbstractOverlayElement.prototype.setMap = function (map) {
AbstractSurfaceElement.prototype.setMap = function (map) {
for (var i = 0; i < this.getGoogleMapObjects().length; i++) {
this.getGoogleMapObjects()[i].setMap(map);
}
};
AbstractOverlayElement.prototype.getBounds = function () {
AbstractSurfaceElement.prototype.getBounds = function () {
var bounds = new google.maps.LatLngBounds();
for (var i = 0; i < this.getGoogleMapObjects().length; i++) {
bounds.extend(this.getGoogleMapObjects()[i].getBounds().getSouthWest());
......@@ -49,7 +49,7 @@ AbstractOverlayElement.prototype.getBounds = function () {
return bounds;
};
AbstractOverlayElement.prototype.isShown = function () {
AbstractSurfaceElement.prototype.isShown = function () {
var result = false;
for (var i = 0; i < this.getGoogleMapObjects().length; i++) {
var map = this.getGoogleMapObjects()[i].getMap();
......@@ -61,7 +61,7 @@ AbstractOverlayElement.prototype.isShown = function () {
return result;
};
AbstractOverlayElement.prototype.show = function () {
AbstractSurfaceElement.prototype.show = function () {
if (this.isShown()) {
logger.warn("Surface already shown");
return;
......@@ -69,23 +69,23 @@ AbstractOverlayElement.prototype.show = function () {
this.setMap(this.getCustomMap().getGoogleMap());
};
AbstractOverlayElement.prototype.hide = function () {
AbstractSurfaceElement.prototype.hide = function () {
this.setMap(null);
};
AbstractOverlayElement.prototype.onClickHandler = function () {
AbstractSurfaceElement.prototype.onClickHandler = function () {
return this.callListeners("onClick");
};
AbstractOverlayElement.prototype.getGoogleMarker = function () {
AbstractSurfaceElement.prototype.getGoogleMarker = function () {
return this.getGoogleMapObjects()[0];
};
AbstractOverlayElement.prototype.getGoogleMapObjects = function () {
AbstractSurfaceElement.prototype.getGoogleMapObjects = function () {
return this._googleMapObjects;
};
AbstractOverlayElement.prototype.addGoogleMapObject = function (googleObject) {
AbstractSurfaceElement.prototype.addGoogleMapObject = function (googleObject) {
this._googleMapObjects.push(googleObject);
var self = this;
......@@ -95,34 +95,34 @@ AbstractOverlayElement.prototype.addGoogleMapObject = function (googleObject) {
google.maps.event.addListener(googleObject, 'click', onclick);
};
AbstractOverlayElement.prototype.getIdentifiedElement = function () {
AbstractSurfaceElement.prototype.getIdentifiedElement = function () {
return this._identifiedElement;
};
AbstractOverlayElement.prototype.setIdentifiedElement = function (identifiedElement) {
AbstractSurfaceElement.prototype.setIdentifiedElement = function (identifiedElement) {
this._identifiedElement = identifiedElement;
};
AbstractOverlayElement.prototype.getBioEntity = function () {
AbstractSurfaceElement.prototype.getBioEntity = function () {
return this._bioEntity;
};
AbstractOverlayElement.prototype.setBioEntity = function (bioEntity) {
AbstractSurfaceElement.prototype.setBioEntity = function (bioEntity) {
this._bioEntity = bioEntity;
};
AbstractOverlayElement.prototype.getModelId = function () {
AbstractSurfaceElement.prototype.getModelId = function () {
return this.getIdentifiedElement().getModelId();
};
AbstractOverlayElement.prototype.updateIdentifiedElement = function (identifiedElement) {
AbstractSurfaceElement.prototype.updateIdentifiedElement = function (identifiedElement) {
if (identifiedElement.getColor() !== undefined) {
this.setColor(identifiedElement.getColor());
}
};
AbstractOverlayElement.prototype.getBounds = function () {
AbstractSurfaceElement.prototype.getBounds = function () {
var self = this;
var bounds = new google.maps.LatLngBounds();
for (var i = 0; i < self.getGoogleMapObjects().length; i++) {
......@@ -139,12 +139,12 @@ AbstractOverlayElement.prototype.getBounds = function () {
*
* @returns {AbstractCustomMap} where surface is located
*/
AbstractOverlayElement.prototype.getCustomMap = function () {
AbstractSurfaceElement.prototype.getCustomMap = function () {
return this._customMap;
};
AbstractOverlayElement.prototype.setCustomMap = function (customMap) {
AbstractSurfaceElement.prototype.setCustomMap = function (customMap) {
this._customMap = customMap;
};
module.exports = AbstractOverlayElement;
module.exports = AbstractSurfaceElement;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment