var EPSG3857 = new OpenLayers.Projection("EPSG:3857"); // google
// tool functions
- function createElement(tagName, attributes={}) {
+ function createElement(tagName, attributes) {
var element = $(document.createElement(tagName));
+ if (attributes === undefined) return element;
for (var attribute in attributes) {
element.attr(attribute, attributes[attribute]);
}
return element;
}
- function appendElement(parentElement, tagName, attributes={}) {
+ function appendElement(parentElement, tagName, attributes) {
+ if (attributes === undefined) attributes = {};
var element = createElement(tagName, attributes);
parentElement.append(element);
return element;