Skip to content

Commit

Permalink
no intersections in areas, card content
Browse files Browse the repository at this point in the history
  • Loading branch information
PetrovaDaria committed Sep 11, 2023
1 parent f6d9cad commit 518f402
Show file tree
Hide file tree
Showing 9 changed files with 52 additions and 135 deletions.
5 changes: 5 additions & 0 deletions components/Layers/Quarter/CardContent/CardContent.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.popup {
border-top-left-radius: inherit;
border-top-right-radius: inherit;
padding: 16px 8px 16px 16px;
}
38 changes: 36 additions & 2 deletions components/Layers/Quarter/CardContent/CardContent.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,41 @@
import React from 'react';
import { Section } from 'components/UI/Card/components/Section/Section';
import { Info } from 'components/UI/Card/components/Info/Info';
import { QuarterObject } from 'components/Layers/Quarter/quarterObject';
import { Link } from 'components/UI/Card/components/Link/Link';
import { Header } from 'components/UI/Card/components/Header/Header';
import styles from './CardContent.module.css';

type QuarterCardContentProps = {
placemark?: QuarterObject;
};

export function QuarterCardContent({ placemark }: QuarterCardContentProps) {
if (!placemark) return null;

export function QuarterCardContent() {
return (
<>данные о квартальных</>
<div className={styles.popup}>
<Header
title={placemark.quarterTitle}
/>
<Section>
<Info
nameColor="#9baac3"
infos={[{
name: 'Район',
text: placemark.districtTitle,
},
{
name: 'Квартал',
text: placemark.quarterTitle,
},
{
name: 'Границы квартала',
text: placemark.quarterDescription,
}]}
/>
<Link href={placemark.url} text="Подробнее о квартале" />
</Section>
</div>
);
}
4 changes: 2 additions & 2 deletions components/Layers/Quarter/quarter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import quarterObjects from 'public/quarter_inspectors.json';
import { QuarterObject } from './quarterObject';

export const quarter = {
getObject(id: string): Promise<QuarterObject> {
getObject(quarterTitle: string): Promise<QuarterObject> {
return Promise.resolve(
quarterObjects.features.find((f) => String(f.properties.id) === id) as unknown as QuarterObject,
quarterObjects.features.find((f) => f.properties.quarterTitle === decodeURI(quarterTitle)).properties as unknown as QuarterObject,
);
},
};
3 changes: 3 additions & 0 deletions components/Layers/Quarter/quarterObject.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
export interface QuarterObject {
districtTitle: string;
quarterTitle: string;
quarterDescription: string;
url: string;
}
8 changes: 2 additions & 6 deletions components/Map/layers/QuarterSource.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,9 @@ export function QuarterSource() {
const map = ekbMap.current;

const handlePointClick = (e) => {
console.log(e);
console.log(e.point);
console.log(e.target.queryRenderedFeatures(e.point)[0]);

const item = e.target.queryRenderedFeatures(e.point)[0];

openPopup(item?.properties?.id, MapItemType.Quarter);
openPopup(decodeURI(item?.properties?.quarterTitle), MapItemType.Quarter);
};

map.on('click', 'ekb-quarter-inspectors-layer', handlePointClick);
Expand All @@ -39,7 +35,7 @@ export function QuarterSource() {
return (
<Source
type="geojson"
data="./quarter_inspectors.json"
data="./quarters-inspectors.geojson"
id="ekb-quarter-inspectors-source"
>
<Layer
Expand Down
2 changes: 2 additions & 0 deletions components/UI/Card/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ export function Card() {

const data = await requestFunction(popupId);

console.log({ data });

setPopupData(data);
setLoading(false);
}
Expand Down
2 changes: 1 addition & 1 deletion components/UI/Card/components/Header/Header.types.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export type HeaderProps = {
coordinates: [number, number] | number[];
coordinates?: [number, number] | number[];
title?: string;
description?: string;
};
124 changes: 0 additions & 124 deletions public/quarter_inspectors.json
Original file line number Diff line number Diff line change
Expand Up @@ -2678,130 +2678,6 @@
"quarterDescription": "От перекрестка пр. Ленина с Московская по Репина до Репина,3. \r\nОт Репина,3 до перекрестка Татищева с Пирогова. \r\nОт Пирогова,2а - до Токарей,27. От Токарей, 27- до Кондратьева,13. \r\nОт Кондратьева,13 – до Кондратьева,23. \r\nОт Кондратьева,23 по мосту до Крылова, 2а. \r\nОт Крылова,2а – до Крылова,4. \r\nВерх-Исетский бульвар,25 – до пр. Ленина, 5\r\nпос. Палкинский торфяник:\r\nул. Нижняя\r\nул. Московская\r\nул. Верхняя\r\nул. Садовая\r\nул. Торфяная\r\nМосковский тракт, 9 км\r\nВершининская\r\nСадоводческие некоммерческие товарищества\r\nпосёлка Палкинский торфяник с 1 по 4 км\r\nгора Хрустальная\r\nпос. Медный: \r\nул. Медная, ул. Фрезерная, ул. Луговая \r\nул. Багерная, ул. Электростилочная\r\nул. Ветренный переулок 3\r\nпос. Медный 2:\r\nул. Архитекторов, ул. Зелёный бульвар, ул. Широтная, ул. Первопроходцев, ул. Застройщиков \r\nул. Студёный переулок, ул. Песчаная, \r\nул. Бобровый переулок\r\nЧусовское озеро:\r\nул. Озёрная, ул. Встречная, ул. Мира, ул. Курортная, ул. Солнечная, ул. Ягодная, ул. Боровая, ул. Зелёная\r\nпос. Карасеозёрский\r\nул. Озерная, ул. Западная, ул. Гологорская \r\nул. Росянка, ул. Дружбы, ул. Зеленогорская \r\nпос. Карасьеозерский-2:\r\nул. Озёрная, ул. Большие караси, пер. Кузинский \r\nпер. Шамарский, ул. Малогородская\r\nул. Московский тракт, 9 км \r\nЧусовской тракт, 7\r\nул. Вершининская - \r\n Автодорога от ЕКАД в посёлок Медный"
}
},
{
"type": "Feature",
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
60.5655142,
56.81078317
],
[
60.56684055,
56.81184519
],
[
60.56772926,
56.81246548
],
[
60.56856476,
56.81299195
],
[
60.57063627,
56.8144844
],
[
60.57183638,
56.815349
],
[
60.57349063,
56.81595396
],
[
60.5753175977043,
56.8163280940795
],
[
60.57778101,
56.81651663
],
[
60.57934876,
56.81648427
],
[
60.5814331570536,
56.8161742773509
],
[
60.58391388,
56.81550163
],
[
60.587588051417,
56.8157868529285
],
[
60.5880601202036,
56.815766300075
],
[
60.5884356294657,
56.8157897890495
],
[
60.5883505292716,
56.8159227424625
],
[
60.58894043,
56.81586497
],
[
60.5902105866446,
56.8125691621405
],
[
60.5910003,
56.81088516
],
[
60.5908420682515,
56.810837343696
],
[
60.59229676,
56.80680303
],
[
60.59186224,
56.80664412
],
[
60.58720569,
56.8029583
],
[
60.58568669,
56.80182344
],
[
60.57945078,
56.80417387
],
[
60.56438633,
56.80985353
],
[
60.5655142,
56.81078317
]
]
]
},
"properties": {
"url": "https://xn--80acgfbsl1azdqr.xn--p1ai/%D1%81%D0%BF%D1%80%D0%B0%D0%B2%D0%BA%D0%B0/%D0%BA%D0%B2%D0%B0%D1%80%D1%82%D0%B0%D0%BB%D1%8C%D0%BD%D1%8B%D0%B5#userId=1671e478-3dff-4c62-ac94-eae38572552f",
"districtTitle": "Ленинский район",
"quarterTitle": "Имущественный комплекс №16",
"quarterDescription": "Ясная\r\nМосковская\r\nАмундсена\r\nВолгоградская"
}
},
{
"type": "Feature",
"geometry": {
Expand Down
1 change: 1 addition & 0 deletions public/quarters-inspectors.geojson

Large diffs are not rendered by default.

0 comments on commit 518f402

Please sign in to comment.