};
function addObject(type, id, center) {
- map.addObject({type: type, id: parseInt(id)}, function(bounds) {
+ map.addObject({type: type, id: parseInt(id, 10)}, function(bounds) {
if (!window.location.hash && bounds.isValid() &&
(center || !map.getBounds().contains(bounds))) {
OSM.router.withoutMoveListener(function () {
};
page.load = function(path, id) {
- if(id)
+ if (id)
currentChangesetId = id;
initialize();
addChangeset(currentChangesetId, true);
};
function addChangeset(id, center) {
- map.addObject({type: 'changeset', id: parseInt(id)}, function(bounds) {
+ map.addObject({type: 'changeset', id: parseInt(id, 10)}, function(bounds) {
if (!window.location.hash && bounds.isValid() &&
(center || !map.getBounds().contains(bounds))) {
OSM.router.withoutMoveListener(function () {
$(form).find("input[type=submit]").prop("disabled", true);
- if(include_data) {
+ if (include_data) {
data = {text: $(form.text).val()};
} else {
data = {};
var template = INSTRUCTION_TEMPLATE[maneuver_id];
// convert lat,lng pairs to LatLng objects
- var step_geometry = L.PolylineUtil.decode(step.geometry, { precision: 5 }).map(function(a) { return L.latLng(a); }) ;
+ var step_geometry = L.PolylineUtil.decode(step.geometry, { precision: 5 }).map(function(a) { return L.latLng(a); });
// append step_geometry on line
Array.prototype.push.apply(line, step_geometry);
});
newNote = L.marker(markerLatlng, {
- icon: noteIcons["new"],
+ icon: noteIcons.new,
opacity: 0.9,
draggable: true
});
getLayersCode: function () {
var layerConfig = '';
- for (var i in this._layers) { // TODO: map.eachLayer
- var layer = this._layers[i];
+ this.eachLayer(function (layer) {
if (layer.options && layer.options.code) {
layerConfig += layer.options.code;
}
- }
+ });
return layerConfig;
},
getMapBaseLayerId: function () {
- for (var i in this._layers) { // TODO: map.eachLayer
- var layer = this._layers[i];
- if (layer.options && layer.options.keyid) return layer.options.keyid;
- }
+ var baseLayer;
+ this.eachLayer(function (layer) {
+ if (layer.options && layer.options.keyid) baseLayer = layer;
+ });
+ return baseLayer.keyid;
},
getUrl: function(marker) {
var control = {},
sidebar = $(selector),
current = $(),
- currentButton = $(),
+ currentButton = $(),
map;
control.addTo = function (_) {
this._map = map;
- this._zoomInButton = this._createButton(
- '', I18n.t('javascripts.map.zoom.in'), zoomName + 'in', container, this._zoomIn, this);
+ this._zoomInButton = this._createButton(
+ '', I18n.t('javascripts.map.zoom.in'), zoomName + 'in', container, this._zoomIn, this);
this._zoomOutButton = this._createButton(
'', I18n.t('javascripts.map.zoom.out'), zoomName + 'out', container, this._zoomOut, this);
"updateLinks": "readonly"
},
"rules": {
+ "dot-notation": "error",
"eqeqeq": ["error", "smart"],
+ "keyword-spacing": "error",
"no-caller": "error",
+ "no-div-regex": "error",
"no-extend-native": "error",
+ "no-extra-bind": "error",
+ "no-floating-decimal": "error",
+ "no-implied-eval": "error",
+ "no-iterator": "error",
+ "no-labels": "error",
+ "no-label-var": "error",
+ "no-lone-blocks": "error",
+ "no-loop-func": "error",
+ "no-multi-str": "error",
"no-new": "error",
+ "no-new-func": "error",
+ "no-new-wrappers": "error",
+ "no-octal-escape": "error",
+ "no-process-env": "error",
+ "no-proto": "error",
+ "no-script-url": "error",
+ "no-self-compare": "error",
+ "no-sequences": "error",
+ "no-shadow-restricted-names": "error",
+ "no-throw-literal": "error",
"no-trailing-spaces": "error",
- "no-undef": "error",
+ "no-unneeded-ternary": "error",
+ "no-unused-expressions": "off",
"no-unused-vars": "error",
"no-use-before-define": ["error", {"functions": false}],
- "semi": ["error", "always"]
+ "no-void": "error",
+ "no-warning-comments": "warn",
+ "no-with": "error",
+ "radix": ["error", "always"],
+ "semi": ["error", "always"],
+ "semi-spacing": "error",
+ "space-unary-ops": "error",
+ "wrap-regex": "off"
}
}