Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
D
default2
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Yuri Bondarenko
default2
Commits
1d171336
Commit
1d171336
authored
May 12, 2019
by
Yuri Bondarenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
up
parent
f50b9dfa
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
16 deletions
+16
-16
src/components/ms-map/ms-map.js
src/components/ms-map/ms-map.js
+16
-16
No files found.
src/components/ms-map/ms-map.js
View file @
1d171336
...
@@ -105,11 +105,11 @@ export default class msMap {
...
@@ -105,11 +105,11 @@ export default class msMap {
console
.
log
(
"
Fetch map data:
"
,
data
);
console
.
log
(
"
Fetch map data:
"
,
data
);
let
id
=
1
;
let
id
=
1
;
data
.
data
.
map
.
layers
.
forEach
(
function
(
layer
)
{
data
.
data
.
map
.
layers
.
forEach
(
layer
=>
{
let
points
=
[];
let
points
=
[];
let
id2
=
1
;
let
id2
=
1
;
layer
.
points
.
forEach
(
function
(
point
)
{
layer
.
points
.
forEach
(
point
=>
{
if
(
!
point
)
return
;
if
(
!
point
)
return
;
points
.
push
({
points
.
push
({
...
@@ -142,11 +142,11 @@ export default class msMap {
...
@@ -142,11 +142,11 @@ export default class msMap {
// data_points.items.push(data_points.items[0]);
// data_points.items.push(data_points.items[0]);
// data_points.items = data_points.items.slice(1, 5);
// data_points.items = data_points.items.slice(1, 5);
this
.
dataPoints
.
items
.
forEach
(
function
(
layer
)
{
/* this.dataPoints.items.forEach(layer =>
{
let liNode = document.createElement("li");
let liNode = document.createElement("li");
liNode.innerText = layer.title;
liNode.innerText = layer.title;
document.querySelector(".ms-map__places").appendChild(liNode);
document.querySelector(".ms-map__places").appendChild(liNode);
});
});
*/
});
});
}
}
...
@@ -188,7 +188,7 @@ export default class msMap {
...
@@ -188,7 +188,7 @@ export default class msMap {
this
.
dataPoints
.
items
.
forEach
(
layer
=>
{
this
.
dataPoints
.
items
.
forEach
(
layer
=>
{
// Группы точек
// Группы точек
this
.
clusterObjects
[
layer
.
title
]
=
[];
clusterObjects
[
layer
.
id
]
=
[];
layer
.
points
.
forEach
(
point
=>
{
layer
.
points
.
forEach
(
point
=>
{
//console.log(point);
//console.log(point);
...
@@ -226,9 +226,9 @@ export default class msMap {
...
@@ -226,9 +226,9 @@ export default class msMap {
}
}
);
);
marker
.
events
.
add
(
"
click
"
,
async
()
=>
{
/*
marker.events.add("click", async () => {
for (var keyLayer in clusterObjects) {
for (var keyLayer in clusterObjects) {
clusterObjects
[
keyLayer
].
forEach
(
function
(
point
)
{
clusterObjects[keyLayer].forEach(
point =>
{
point.options.set({
point.options.set({
iconImageHref: this.basePathPin,
iconImageHref: this.basePathPin,
iconImageSize: [30, 30],
iconImageSize: [30, 30],
...
@@ -318,7 +318,7 @@ export default class msMap {
...
@@ -318,7 +318,7 @@ export default class msMap {
document.querySelector(".ms-map__close").style.display = "block";
document.querySelector(".ms-map__close").style.display = "block";
if (window.matchMedia("(max-width: 640px)").matches) {
if (window.matchMedia("(max-width: 640px)").matches) {
/
* mobile */
/
/ mobile
if (this.isEventVisible) {
if (this.isEventVisible) {
if (this.popup) {
if (this.popup) {
this.popup.destroy(true);
this.popup.destroy(true);
...
@@ -326,26 +326,26 @@ export default class msMap {
...
@@ -326,26 +326,26 @@ export default class msMap {
this.isEventVisible = false;
this.isEventVisible = false;
}
}
} else {
} else {
/
* global lightGallery */
/
/ global lightGallery
this.popup = lightGallery(document.getElementById("map-event"));
this.popup = lightGallery(document.getElementById("map-event"));
this.isEventVisible = true;
this.isEventVisible = true;
}
}
} else {
} else {
/
* desktop */
/
/ desktop
if (this.isEventVisible) {
if (this.isEventVisible) {
document.querySelector(".ms-map__event").style.display = "none";
document.querySelector(".ms-map__event").style.display = "none";
} else {
} else {
document.querySelector(".ms-map__event").style.display = "block";
document.querySelector(".ms-map__event").style.display = "block";
}
}
}
}
});
});
*/
this
.
clusterObjects
[
layer
.
title
].
push
(
marker
);
clusterObjects
[
layer
.
id
].
push
(
marker
);
this
.
clusterer
.
add
(
marker
);
this
.
clusterer
.
add
(
marker
);
});
});
this
.
map
.
geoObjects
.
add
(
this
.
clusterer
);
/*
this.map.geoObjects.add(this.clusterer);
this
.
objectManager
.
add
(
this
.
clusterObjects
);
this.objectManager.add(
clusterObjects); */
});
});
// удаляем лишние контролы
// удаляем лишние контролы
...
@@ -364,14 +364,14 @@ export default class msMap {
...
@@ -364,14 +364,14 @@ export default class msMap {
this
.
map
.
behaviors
.
disable
([
"
scrollZoom
"
]);
this
.
map
.
behaviors
.
disable
([
"
scrollZoom
"
]);
// автомасштаб
// автомасштаб
this
.
map
/*
this.map
.setBounds(this.clusterer.getBounds(), {
.setBounds(this.clusterer.getBounds(), {
checkZoomRange: true,
checkZoomRange: true,
zoomMargin: [20, 20, 20, 20]
zoomMargin: [20, 20, 20, 20]
})
})
.then(function() {
.then(function() {
//if( map.getZoom() > 15) map.setZoom(15);
//if( map.getZoom() > 15) map.setZoom(15);
});
});
*/
});
});
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment