Commit 6d71af6e authored by Piotr Gawron's avatar Piotr Gawron
Browse files

bottom-left/right controls added

parent acf98a9a
......@@ -4,7 +4,7 @@
"description": "frontentd for minerva google maps interface",
"main": "minerva.js",
"scripts": {
"build:css": "cleancss --skip-rebase -o dist/minerva.css node_modules/dual-listbox/dist/*.css node_modules/multi-checkbox-list/dist/*.css src/main/css/*.css",
"build:css": "cleancss --skip-rebase -o dist/minerva.css node_modules/openlayers/dist/ol.css node_modules/dual-listbox/dist/*.css node_modules/multi-checkbox-list/dist/*.css src/main/css/*.css",
"build:js": "browserify --debug --standalone minerva src/main/js/minerva.js | exorcist dist/minerva.js.map > dist/minerva.js ",
"//": "rm -rf dist & rmdir /q /s dist & mkdir dist & browserify --debug --standalone minerva src/main/js/minerva.js | exorcist dist/minerva.js.map > dist/minerva.js & uglifyjs --compress --mangle --in-source-map dist/minerva.js.map --source-map-include-sources --source-map dist/minerva.min.js.map -o dist/minerva.min.js dist/minerva.js",
"build-deploy": "npm run build && npm run deploy",
......
......@@ -697,3 +697,20 @@ a.adminLink:hover {
font-size: 13px;
font-weight: 900
}
/* custom open layers styling */
.labelText {
font-size: 13px;
font-weight: 900
}
.minerva-ol-bottom-left{
bottom: .5em;
left: .5em;
}
.minerva-ol-bottom-right{
bottom: .5em;
right: .5em;
}
\ No newline at end of file
......@@ -238,6 +238,14 @@ Functions.getElementByName = function (element, name) {
return undefined;
};
/**
*
* @param params.type {string} type of the {HTMLElement} to be created
* @param params.className {string} css class of the element
* @param params.style {string} css styling
*
* @returns {HTMLElement}
*/
Functions.createElement = function (params) {
var result = document.createElement(params.type);
if (params.id !== null && params.id !== undefined) {
......
......@@ -17,6 +17,11 @@ function OpenLayerCanvas(element, options) {
$(element).css("background-color", "#e4e2de");
var self = this;
self.setOpenLayersMap(new ol.Map({
controls: ol.control.defaults({
attributionOptions: {
collapsible: false
}
}),
target: element,
layers: self.createLayers(options),
view: new ol.View({
......@@ -130,12 +135,24 @@ OpenLayerCanvas.prototype.createPolyline = function (options) {
logger.fatal("Not implemented");
};
/**
*
* @param {HTMLElement} element
*/
OpenLayerCanvas.prototype.addLeftBottomControl = function (element) {
logger.fatal("Not implemented");
var wrapper = Functions.createElement({type: "div", className: "ol-control minerva-ol-bottom-left"});
wrapper.appendChild(element);
this.getOpenLayersMap().addControl(new ol.control.Control({element: wrapper}));
};
/**
*
* @param {HTMLElement} element
*/
OpenLayerCanvas.prototype.addRightBottomControl = function (element) {
logger.fatal("Not implemented");
var wrapper = Functions.createElement({type: "div", className: "ol-control minerva-ol-bottom-right"});
wrapper.appendChild(element);
this.getOpenLayersMap().addControl(new ol.control.Control({element: wrapper}));
};
OpenLayerCanvas.prototype.fitBounds = function (bounds) {
......
Supports Markdown
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