c80_map_floors 0.1.0.3 → 0.1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/assets/javascripts/buttons/button_back_to_map.js +3 -2
- data/app/assets/javascripts/c80_map_floors.js.coffee +1 -0
- data/app/assets/javascripts/lib/obj_size.js +31 -0
- data/app/assets/javascripts/map_objects/area.js +14 -14
- data/app/assets/javascripts/map_objects/building.js +27 -10
- data/app/assets/javascripts/src/main.js +48 -47
- data/app/assets/javascripts/src/state_controller.js +76 -18
- data/app/assets/javascripts/src/utils/i18n.js +26 -0
- data/app/assets/javascripts/ui/tabs/tabs.js +114 -31
- data/app/assets/javascripts/view/building_info/building_info.js +20 -9
- data/app/assets/javascripts/view/building_info/mobj_info_parser.js +57 -0
- data/app/assets/stylesheets/c80_map_floors.scss +1 -0
- data/app/assets/stylesheets/ui/tabs_js.scss +32 -0
- data/app/assets/stylesheets/view/elems/building_info.scss +0 -19
- data/app/controllers/c80_map_floors/ajax_controller.rb +1 -0
- data/app/models/c80_map_floors/area.rb +15 -6
- data/app/models/c80_map_floors/area_representator.rb +19 -2
- data/app/models/c80_map_floors/base_map_object.rb +8 -3
- data/app/models/c80_map_floors/building_representator.rb +27 -3
- data/app/models/c80_map_floors/floor.rb +52 -0
- data/app/models/c80_map_floors/floor_representator.rb +65 -0
- data/app/models/c80_map_floors/map_building.rb +127 -7
- data/app/models/c80_map_floors/map_json.rb +2 -2
- data/app/views/c80_map_floors/ajax/shared/_select_list_unlinked_buildings.html.erb +1 -1
- data/db/migrate/20161015190003_add_building_representator_to_c80_map_floors_buildings.rb +1 -1
- data/db/migrate/20161128181616_add_map_floor_representator_to_c80_map_floors_floors.rb +6 -0
- data/lib/c80_map_floors/version.rb +1 -1
- metadata +8 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 91d37bea3434e0d10977e8898d1db9795c43a7cd
|
4
|
+
data.tar.gz: 0aa35d9922a21214f3c00362cab648250b9beb6d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e56584f2ae7aa2536b880c7ac011de97003d32bf913fc2bff321e6697433ecb42ad2696b50bd6cb0e2abcbc4ef4a1520c9627ebc225f6d0b669d0928ed3853d3
|
7
|
+
data.tar.gz: 114a367c49d227dac7aa1008a7f51855604c12581048e9e3b14332be9c03160747c63ad78537812e4ad3ff1bbaadd62974e341b48e2a97647ce390b3e8bc977a
|
@@ -44,6 +44,7 @@ function BackToMapButton() {
|
|
44
44
|
_cnt = $('<div></div>').addClass('back_to_map_button');
|
45
45
|
_cnt.appendTo($(parent_div_selector));
|
46
46
|
_btn = $('<a href="#" id="BackToMapButton">Обратно на карту</a>');
|
47
|
+
//noinspection JSUnresolvedFunction
|
47
48
|
_btn.on('click', _onClick);
|
48
49
|
_cnt.append(_btn);
|
49
50
|
|
@@ -53,8 +54,8 @@ function BackToMapButton() {
|
|
53
54
|
|
54
55
|
_this.show = function () {
|
55
56
|
|
56
|
-
// хардкод - подгоняем под длину анимации, прописанной в css
|
57
|
-
setTimeout(__show,
|
57
|
+
// хардкод - подгоняем под длину анимации, прописанной в css (+200 ms на возможный лаг)
|
58
|
+
setTimeout(__show, 1000);
|
58
59
|
|
59
60
|
|
60
61
|
};
|
@@ -22,6 +22,7 @@
|
|
22
22
|
#= require ./src/utils/utils.js
|
23
23
|
#= require ./src/utils/opacity_buttons_utils.js
|
24
24
|
#= require ./src/utils/map_utils.js
|
25
|
+
#= require ./src/utils/i18n.js
|
25
26
|
#= require ./src/state_controller.js
|
26
27
|
#= require ./src/image_loader.js
|
27
28
|
#= require ./src/main.js
|
@@ -0,0 +1,31 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
// StackOverflow: How to get object length
|
4
|
+
// http://stackoverflow.com/a/24457767/4209080
|
5
|
+
|
6
|
+
//noinspection JSUnusedGlobalSymbols
|
7
|
+
var fCalcObjSize = function (obj) {
|
8
|
+
var count = 0;
|
9
|
+
|
10
|
+
if (typeof obj == "object") {
|
11
|
+
|
12
|
+
if (Object.keys) {
|
13
|
+
count = Object.keys(obj).length;
|
14
|
+
} else {
|
15
|
+
//noinspection JSUnresolvedVariable
|
16
|
+
if (window._) {
|
17
|
+
//noinspection JSUnresolvedVariable
|
18
|
+
count = _.keys(obj).length;
|
19
|
+
} else if (window.$) {
|
20
|
+
count = $.map(obj, function () {
|
21
|
+
return 1;
|
22
|
+
}).length;
|
23
|
+
} else {
|
24
|
+
for (var key in obj) if (obj.hasOwnProperty(key)) count++;
|
25
|
+
}
|
26
|
+
}
|
27
|
+
|
28
|
+
}
|
29
|
+
|
30
|
+
return count;
|
31
|
+
};
|
@@ -26,10 +26,10 @@ function Area() {
|
|
26
26
|
//_this.is_new = false;
|
27
27
|
|
28
28
|
_this.init = function (options, parent_building_hash, pself) {
|
29
|
-
|
30
|
-
//
|
29
|
+
console.log("<Area.init>");
|
30
|
+
//console.log(parent_building_hash); // => see building.js init comment
|
31
31
|
|
32
|
-
//
|
32
|
+
//console.log(options);
|
33
33
|
/*{
|
34
34
|
"id": 1,
|
35
35
|
"object_type": "area",
|
@@ -68,7 +68,7 @@ function Area() {
|
|
68
68
|
}
|
69
69
|
|
70
70
|
_this._options.parent_building_hash = parent_building_hash;
|
71
|
-
//
|
71
|
+
//console.log(_this._options.parent_building_hash);
|
72
72
|
|
73
73
|
|
74
74
|
_this._polygon = Polygon.createFromSaved(options, false, _map);
|
@@ -108,7 +108,7 @@ function Area() {
|
|
108
108
|
|
109
109
|
_this.enter = function () {
|
110
110
|
//console.log("<Area.enter>");
|
111
|
-
//
|
111
|
+
//console.log(_this._options);
|
112
112
|
|
113
113
|
/* рассчитаем масштаб, при котором можно вписать прямоугольник дома в прямоугольник рабочей области */
|
114
114
|
|
@@ -132,8 +132,8 @@ function Area() {
|
|
132
132
|
scale: scale
|
133
133
|
});
|
134
134
|
|
135
|
-
//
|
136
|
-
//
|
135
|
+
//console.log("<Area.enter> [qq] moveTo: " + _map.x + ", " + _map.y);
|
136
|
+
//console.log("<Area.enter> Call moveTo.");
|
137
137
|
_map.moveTo(x, y, scale, 400, 'easeInOutCubic');
|
138
138
|
|
139
139
|
setTimeout(timeoutEnter, 400);
|
@@ -141,7 +141,7 @@ function Area() {
|
|
141
141
|
var k;
|
142
142
|
if (_map.current_area != null) {
|
143
143
|
k = _map.current_area._polygon.parent().attr('class');
|
144
|
-
//
|
144
|
+
//console.log("k = " + k);
|
145
145
|
k = k.split('viewing_area').join("");
|
146
146
|
_map.current_area._polygon.parent().attr("class", k);
|
147
147
|
}
|
@@ -188,7 +188,7 @@ function Area() {
|
|
188
188
|
ix = coords[i];
|
189
189
|
iy = coords[i + 1];
|
190
190
|
|
191
|
-
//
|
191
|
+
//console.log(xmin + " VS " + ix);
|
192
192
|
xmin = (ix < xmin) ? ix : xmin;
|
193
193
|
ymin = (iy < ymin) ? iy : ymin;
|
194
194
|
|
@@ -207,19 +207,19 @@ function Area() {
|
|
207
207
|
_cx = xmin + (xmax - xmin) / 2;
|
208
208
|
_cy = ymin + (ymax - ymin) / 2;
|
209
209
|
|
210
|
-
//
|
210
|
+
//console.log("<Area._calcBBox> " +
|
211
211
|
//xmin + "," + ymin + "; " + xmax + "," + ymax +
|
212
212
|
//"; center logical: " + _cx + "," + _cy + ", center screen: " + _map.rightX(_cx) + ", " + _map.rightY(_cy));
|
213
213
|
};
|
214
214
|
|
215
215
|
_this._mouse_in = function () {
|
216
|
-
//
|
217
|
-
//
|
216
|
+
//console.log('<Area._mouse_in>');
|
217
|
+
//console.log(_this._polygon);
|
218
218
|
_this._polygon.attr('class', 'hover');
|
219
219
|
};
|
220
220
|
|
221
221
|
_this._mouse_out = function () {
|
222
|
-
//
|
222
|
+
//console.log('<Area._mouse_out>');
|
223
223
|
_this._polygon.attr('class', '');
|
224
224
|
};
|
225
225
|
|
@@ -234,7 +234,7 @@ function Area() {
|
|
234
234
|
res += ix + "px " + iy + "px,"
|
235
235
|
}
|
236
236
|
|
237
|
-
//
|
237
|
+
//console.log("<Area._calc_polygon_attr> res = " + res);
|
238
238
|
res = res.slice(0, res.length - 1);
|
239
239
|
res = "-webkit-clip-path:polygon(" + res + ")";
|
240
240
|
return res;
|
@@ -7,8 +7,8 @@ function Building() {
|
|
7
7
|
var _options = null;
|
8
8
|
var _polygon = null;
|
9
9
|
|
10
|
-
// хэш с
|
11
|
-
var
|
10
|
+
// хэш с этажами здания
|
11
|
+
var _map_floors_hash = {};
|
12
12
|
|
13
13
|
// экранные координаты левой верхней точки, куда надо вписать полигон здания
|
14
14
|
//var _left_page_x = 342;
|
@@ -130,7 +130,7 @@ function Building() {
|
|
130
130
|
for (i = 0; i < options_floors.length; i++) {
|
131
131
|
ifloor_json = options_floors[i];
|
132
132
|
ifloor_id = ifloor_json["id"];
|
133
|
-
|
133
|
+
_map_floors_hash[ ifloor_id ] = ifloor_json;
|
134
134
|
}
|
135
135
|
|
136
136
|
};
|
@@ -190,13 +190,30 @@ function Building() {
|
|
190
190
|
|
191
191
|
setTimeout(function () {
|
192
192
|
|
193
|
-
// попросим изменить состояние окружающей среды
|
194
|
-
_map.setMode('view_building');
|
195
|
-
|
196
193
|
// запустим внутренний механизм парсинга этажей и их отрисовки
|
197
194
|
_proccess_floors_data();
|
198
195
|
|
199
|
-
|
196
|
+
// если у ПолигонаЗдания есть ПолигоныЭтажей - войдем в 1й этаж
|
197
|
+
if (fCalcObjSize(_map_floors_hash) > 0) {
|
198
|
+
console.log("<Building.enter> У ПолигонаЗдания есть ПолигоныЭтажей - войдём на 1й этаж.");
|
199
|
+
|
200
|
+
// клик по первой tab-кнопке заставит войти на 1й этаж
|
201
|
+
_map.building_info_klass.setSelectedFloor(0);
|
202
|
+
|
203
|
+
// попросим изменить состояние окружающей среды
|
204
|
+
_map.setMode('view_floor');
|
205
|
+
|
206
|
+
}
|
207
|
+
// если у здания нет этажей - перейдём в режим просмотра здания
|
208
|
+
else {
|
209
|
+
console.log("<Building.enter> У ПолигонаЗдания НЕТ ПолигоновЭтажей - просто войдём в Здание.");
|
210
|
+
|
211
|
+
// NOTE:: но кнопки этажей могут при этом быть отрисованы - т.к. кнопки строятся по ПолигонамЭтажей.
|
212
|
+
|
213
|
+
// попросим изменить состояние окружающей среды
|
214
|
+
_map.setMode('view_building');
|
215
|
+
}
|
216
|
+
|
200
217
|
|
201
218
|
}, 400);
|
202
219
|
|
@@ -209,17 +226,17 @@ function Building() {
|
|
209
226
|
};
|
210
227
|
|
211
228
|
/**
|
212
|
-
* Войти на этаж
|
229
|
+
* Войти на этаж здания - т.е. НАРИСОВАТЬ картинку этажа.
|
213
230
|
* @param floor_id
|
214
231
|
*/
|
215
232
|
_this.enterFloor = function (floor_id) {
|
216
233
|
console.log('<Building.enterFloor> floor_id: ' + floor_id);
|
217
234
|
|
218
|
-
var flr =
|
235
|
+
var flr = _map_floors_hash[floor_id];
|
219
236
|
if (flr != undefined) {
|
220
237
|
_draw_floor(flr);
|
221
238
|
} else {
|
222
|
-
alert('[
|
239
|
+
alert('[Building.EnterFloor] error: Нет данных об этаже [карты] floor_id='+floor_id+'.');
|
223
240
|
}
|
224
241
|
|
225
242
|
|
@@ -39,10 +39,6 @@ var InitMap = function (params) {
|
|
39
39
|
|
40
40
|
};
|
41
41
|
|
42
|
-
var clog = function () {
|
43
|
-
console.log(arguments[0]);
|
44
|
-
};
|
45
|
-
|
46
42
|
(function () {
|
47
43
|
|
48
44
|
var Map = function () {
|
@@ -236,7 +232,7 @@ var clog = function () {
|
|
236
232
|
div_css_selector: '#container_buttons .mzoom_buttons'
|
237
233
|
}
|
238
234
|
}).done(function () {
|
239
|
-
|
235
|
+
console.log('<ajax.done>');
|
240
236
|
|
241
237
|
self.edit_button_klass = new EditButton();
|
242
238
|
self.edit_button_klass.init('.mapplic-edit-button', self);
|
@@ -356,7 +352,7 @@ var clog = function () {
|
|
356
352
|
y: self.CY - self.scale * cy - self.container.offset().top,
|
357
353
|
scale: self.scale
|
358
354
|
});
|
359
|
-
|
355
|
+
console.log("<$(window).resize> call moveTo");
|
360
356
|
self.moveTo(self.x, self.y, self.scale, 100);
|
361
357
|
|
362
358
|
// если пользователь ещё не взаимодействовал с картой (т.е. она только загрузилась и готова к использованию)
|
@@ -391,14 +387,13 @@ var clog = function () {
|
|
391
387
|
}; // IE drag fix
|
392
388
|
|
393
389
|
function onSvgMousedown(e) {
|
394
|
-
clog("<onSvgMousedown> self.mode = " + self.mode);
|
395
390
|
|
396
391
|
if (self.mode === 'editing' || self.mode === "edit_building" || self.mode === 'edit_area') {
|
397
392
|
if (e.target.parentNode.tagName === 'g') {
|
398
|
-
|
399
|
-
//
|
400
|
-
//
|
401
|
-
//
|
393
|
+
console.log("<onSvgMousedown> e = ");
|
394
|
+
//console.log(e.pageX);
|
395
|
+
//console.log("<mouseDown> e.target.parentNode.tagName = " + e.target.parentNode.tagName);
|
396
|
+
//console.log(e.target);
|
402
397
|
//info.unload();
|
403
398
|
|
404
399
|
// запомним ссылку на "выбранную" область
|
@@ -418,8 +413,8 @@ var clog = function () {
|
|
418
413
|
// если взаимодействуем с вершиной
|
419
414
|
if (utils.hasClass(e.target, 'helper')) {
|
420
415
|
var helper = e.target;
|
421
|
-
//
|
422
|
-
//
|
416
|
+
//console.log("<mouseDown> helper.action = ");
|
417
|
+
//console.log(helper.action);
|
423
418
|
self.edit_type = helper.action; // pointMove
|
424
419
|
|
425
420
|
if (helper.n >= 0) { // if typeof selected_area == polygon
|
@@ -449,9 +444,9 @@ var clog = function () {
|
|
449
444
|
|
450
445
|
// Drag & drop
|
451
446
|
function onDragNdrop(event) {
|
452
|
-
//
|
447
|
+
//console.log("<mousedown> edit_type = " + self.edit_type);
|
453
448
|
console.log("<mousedown> mode = " + self.mode + " dnd_enable = " + self.o.dnd_enable);
|
454
|
-
//
|
449
|
+
//console.log(event);
|
455
450
|
|
456
451
|
// если в данный момент не редактируем фигуру (т.е. не двигаем вершину фигуры)
|
457
452
|
if (self.edit_type == null) {
|
@@ -483,25 +478,26 @@ var clog = function () {
|
|
483
478
|
scale: self.scale
|
484
479
|
});
|
485
480
|
|
486
|
-
//
|
487
|
-
//
|
481
|
+
//console.log("<Map.mousemove> x = " + x + "; y = " + y);
|
482
|
+
//console.log("<Map.mousemove> Call moveTo.");
|
488
483
|
self.moveTo(x, y); /* NOTE:: вызывается во время dnd */
|
489
484
|
map.data('lastX', x);
|
490
485
|
map.data('lastY', y);
|
491
486
|
}
|
492
487
|
});
|
493
488
|
|
489
|
+
//noinspection JSUnresolvedFunction
|
494
490
|
$(document).on('mouseup', function (event) {
|
495
|
-
//
|
496
|
-
//
|
497
|
-
//
|
498
|
-
//
|
499
|
-
//
|
491
|
+
//console.log("<mouseup> dragging = " + self.dragging + ", mode = " + self.mode + "; is_draw = " + self.is_draw + "; scale = " + self.scale);
|
492
|
+
//console.log("<mouseup> event = ");
|
493
|
+
//console.log(event);
|
494
|
+
//console.log("<mouseup> event.target = ");
|
495
|
+
//console.log($(event.target).parent()[0].obj);
|
500
496
|
|
501
|
-
//
|
497
|
+
//console.log("<mouseup> [qq] screen: " + event.pageX + ", " + event.pageY +
|
502
498
|
//"; logic: " + self.rightX(event.pageX) + ", " + self.rightY(event.pageY));
|
503
499
|
|
504
|
-
|
500
|
+
console.log("<mouseup> Отпустили мышь после клика, текущий режим карты: mode = " + self.mode);
|
505
501
|
|
506
502
|
// исключаем случайный dnd дрожащей рукой
|
507
503
|
var dx = map.data('startX') - map.data('lastX');
|
@@ -523,13 +519,13 @@ var clog = function () {
|
|
523
519
|
|
524
520
|
/* если находимся в режиме просмотра всей карты - входим в здание */
|
525
521
|
if (self.mode == 'viewing') {
|
526
|
-
//
|
522
|
+
//console.log($(event.target).parent()[0].obj.building);
|
527
523
|
|
528
524
|
// добираемся до объекта класса Здание, который обслуживает полигон
|
529
525
|
p = $(event.target).parent()[0];
|
530
526
|
if (p.obj && p.obj.building) {
|
531
527
|
var building = p.obj.building;
|
532
|
-
|
528
|
+
console.log("<mouseup> Текущий mode карты 'viewing' => Входим в здание (а потом building сам решит, входить ли на 1й этаж).");
|
533
529
|
self.current_building = building;
|
534
530
|
building.enter();
|
535
531
|
}
|
@@ -544,7 +540,7 @@ var clog = function () {
|
|
544
540
|
|
545
541
|
var xx = self.rightX(event.pageX);
|
546
542
|
var yy = self.rightY(event.pageY);
|
547
|
-
//
|
543
|
+
//console.log("<mouseup> " + xx + "; " + yy);
|
548
544
|
|
549
545
|
self.drawing_poligon = new Polygon(xx, yy, false, self);
|
550
546
|
|
@@ -595,7 +591,7 @@ var clog = function () {
|
|
595
591
|
|
596
592
|
// добираемся до объекта класса Area, который обслуживает полигон
|
597
593
|
p = $viewing_g_from_svg_overlay[0];
|
598
|
-
//
|
594
|
+
//console.log($(event.target).parent()[0].obj.area_hash);
|
599
595
|
|
600
596
|
if (p.obj && p.obj.area) {
|
601
597
|
|
@@ -603,15 +599,18 @@ var clog = function () {
|
|
603
599
|
self.last_clicked_g = $viewing_g_from_svg_overlay;
|
604
600
|
|
605
601
|
var area = p.obj.area;
|
606
|
-
|
607
|
-
|
602
|
+
console.log("<mouseup> Входим в площадь. self.last_clicked_g = ");
|
603
|
+
console.log(self.last_clicked_g);
|
608
604
|
area.enter();
|
609
605
|
}
|
610
606
|
|
611
607
|
}
|
608
|
+
|
612
609
|
}
|
613
610
|
|
611
|
+
//noinspection JSUnresolvedFunction
|
614
612
|
self.map.off('mousemove');
|
613
|
+
//noinspection JSUnresolvedFunction
|
615
614
|
$(document).off('mouseup');
|
616
615
|
|
617
616
|
map.removeClass('mdragging');
|
@@ -619,7 +618,9 @@ var clog = function () {
|
|
619
618
|
}
|
620
619
|
}
|
621
620
|
|
621
|
+
//noinspection JSUnresolvedFunction
|
622
622
|
self.svg.on('mousedown', onDragNdrop);
|
623
|
+
//noinspection JSUnresolvedFunction
|
623
624
|
self.svg_overlay.on('mousedown', onDragNdrop);
|
624
625
|
|
625
626
|
self.el[0].addEventListener('mousemove', function (e) {
|
@@ -648,7 +649,7 @@ var clog = function () {
|
|
648
649
|
|
649
650
|
// какой должен быть минимальный масштаб, чтобы вписать отрезок [min,max] в отрезок [p1,p2]
|
650
651
|
self.calcScale = function (min, max, p1, p2) {
|
651
|
-
//
|
652
|
+
//console.log("<calcScale> [" + min + "," + max + '] to [' + p1 + "," + p2 + "]");
|
652
653
|
return (p2 - p1) / (max - min);
|
653
654
|
};
|
654
655
|
|
@@ -667,7 +668,7 @@ var clog = function () {
|
|
667
668
|
var _$address_p = $('#paddress'); // 20161003: после редизайна надо дополнительно позиционировать блок с адресом
|
668
669
|
|
669
670
|
self.ivalidateViewArea = function () {
|
670
|
-
//
|
671
|
+
//console.log('<init> _$b.offset().left = ' + _$b.offset().left);
|
671
672
|
|
672
673
|
// рассчитаем "константы" - прямоугольник, в который надо вписывать картинки зданий при входе в них
|
673
674
|
self.X1 = _$b.offset().left + 100;
|
@@ -786,7 +787,7 @@ var clog = function () {
|
|
786
787
|
* можно было отобразить характеристики Здания родителя C80Rent:Building.
|
787
788
|
*/
|
788
789
|
self.draw_childs = function (childs, parent_hash) {
|
789
|
-
//
|
790
|
+
//console.log("<Map.draw_childs>");
|
790
791
|
|
791
792
|
//var ip;
|
792
793
|
var iobj;
|
@@ -925,14 +926,14 @@ var clog = function () {
|
|
925
926
|
|
926
927
|
self.onEdit = function (e) {
|
927
928
|
|
928
|
-
//
|
929
|
-
//
|
930
|
-
//
|
931
|
-
//
|
929
|
+
//console.log("<Polygon.prototype.onEdit> _s_f = " + _s_f);
|
930
|
+
//console.log("<Polygon.prototype.onEdit> e = ");
|
931
|
+
//console.log(_s_f);
|
932
|
+
//console.log(e.pageX);
|
932
933
|
|
933
934
|
var selected_area = self.selected_area;
|
934
935
|
var edit_type = self.edit_type;
|
935
|
-
//
|
936
|
+
//console.log("<Polygon.prototype.onEdit> edit_type = " + edit_type);
|
936
937
|
|
937
938
|
selected_area.dynamicEdit(selected_area[edit_type](e.pageX - selected_area.delta.x, e.pageY - selected_area.delta.y));
|
938
939
|
selected_area.delta.x = e.pageX;
|
@@ -940,7 +941,7 @@ var clog = function () {
|
|
940
941
|
};
|
941
942
|
|
942
943
|
self.onDrawStop = function (e) {
|
943
|
-
|
944
|
+
console.log("<Map.onDrawStop>");
|
944
945
|
|
945
946
|
if (e != undefined) {
|
946
947
|
if (e.type == 'keydown' && e.keyCode == 13) {
|
@@ -984,7 +985,7 @@ var clog = function () {
|
|
984
985
|
};
|
985
986
|
|
986
987
|
self.onEditStop = function (e) {
|
987
|
-
//
|
988
|
+
//console.log("<Polygon.prototype.onEditStop>");
|
988
989
|
var _s_f = self.selected_area,
|
989
990
|
edit_type = self.edit_type;
|
990
991
|
|
@@ -1055,7 +1056,7 @@ var clog = function () {
|
|
1055
1056
|
* @returns {*}
|
1056
1057
|
*/
|
1057
1058
|
self.normalizeScale = function (scale) {
|
1058
|
-
|
1059
|
+
console.log('<self.normalizeScale>' + self.o.fitscale);
|
1059
1060
|
if (scale < self.o.fitscale) scale = self.o.fitscale;
|
1060
1061
|
else if (scale > self.o.maxscale) scale = self.o.maxscale;
|
1061
1062
|
|
@@ -1074,7 +1075,7 @@ var clog = function () {
|
|
1074
1075
|
self.x = self.normalizeX(self.container.width() * 0.5 - self.scale * self.contentWidth * x);
|
1075
1076
|
self.y = self.normalizeY(self.container.height() * ry - self.scale * self.contentHeight * y);
|
1076
1077
|
|
1077
|
-
|
1078
|
+
console.log("<Map.zoomTo> Call moveTo.");
|
1078
1079
|
self.moveTo(self.x, self.y, self.scale, duration, easing);
|
1079
1080
|
};*/
|
1080
1081
|
|
@@ -1095,7 +1096,7 @@ var clog = function () {
|
|
1095
1096
|
* Т.е. желателен рефакторинг и упрощение логики, но не сейчас.
|
1096
1097
|
* */
|
1097
1098
|
var __afterMovingCorrectSvgLayersPositions = function () {
|
1098
|
-
//
|
1099
|
+
//console.log(self.map.attr('style'));
|
1099
1100
|
// left: -69.9985px; top: -299.999px;
|
1100
1101
|
// left: [-]{0,1}(\d+\.\d+px);
|
1101
1102
|
|
@@ -1109,7 +1110,7 @@ var clog = function () {
|
|
1109
1110
|
var x = -1 * Number(match_left[1]); // ["left: -69.9985px;", "69.9985"]
|
1110
1111
|
var y = -1 * Number(match_right[1]); // ["left: -69.9985px;", "69.9985"]
|
1111
1112
|
var att = x + " " + y + " " + self.contentWidth + " " + self.contentHeight;
|
1112
|
-
//
|
1113
|
+
//console.log(x + "; y = " + y);
|
1113
1114
|
self.svg.attr('viewBox', att);
|
1114
1115
|
self.svg_overlay.attr('viewBox', att);
|
1115
1116
|
}
|
@@ -1181,8 +1182,8 @@ var clog = function () {
|
|
1181
1182
|
// x,y - экранные координаты
|
1182
1183
|
// сюда подаётся scale, который нужно присвоить map после анимации
|
1183
1184
|
self.moveTo = function (x, y, scale, d, easing) {
|
1184
|
-
|
1185
|
-
//
|
1185
|
+
console.log("<self.moveTo> x = " + x + "; y = " + y + "; scale = " + scale + "; delay = " + d);
|
1186
|
+
//console.log('<self.moveTo>');
|
1186
1187
|
|
1187
1188
|
// если подан аргумент scale(масштаб)
|
1188
1189
|
// перемещаемся анимированно
|
@@ -1290,7 +1291,7 @@ var clog = function () {
|
|
1290
1291
|
|
1291
1292
|
// показать инфо о просматриваемой площади
|
1292
1293
|
self.showAreaInfo = function (area_hash, parent_building_hash) {
|
1293
|
-
//
|
1294
|
+
//console.log(area_hash);
|
1294
1295
|
|
1295
1296
|
//"area_hash": {
|
1296
1297
|
// "id": 2,
|