Spaces:
Running

File size: 8,083 Bytes
446b956
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
<!DOCTYPE html>
<html lang="ru">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Карта проектов | ЗемЭкспертAI</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <script src="https://unpkg.com/feather-icons"></script>
    <script src="https://api-maps.yandex.ru/2.1/?apikey=ваш_api_ключ&lang=ru_RU"></script>
    <style>
      @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
      body {
        font-family: 'Inter', sans-serif;
        height: 100vh;
        margin: 0;
      }
      #map {
        width: 100%;
        height: calc(100vh - 64px);
      }
      .marker-info {
        padding: 10px;
        background: white;
        border-radius: 8px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.2);
        min-width: 200px;
      }
    </style>
</head>
<body class="bg-primary text-gray-800">
  <!-- Навигация -->
  <nav class="bg-primary/90 backdrop-blur-md border-b border-gray-100 fixed w-full z-50">
    <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
      <div class="flex justify-between h-16">
        <div class="flex items-center">
          <span class="text-accent font-bold text-xl flex items-center">
            <img src="https://static.photos/green/200x200/42" class="h-8 w-8 rounded-full mr-2" alt="Лого">
            ЗемЭкспертAI
          </span>
        </div>
        <div class="hidden md:flex items-center space-x-8">
          <a href="index.html" class="text-gray-700 hover:text-secondary font-medium">Главная</a>
          <a href="map.html" class="text-secondary font-medium">Карта</a>
          <a href="catalog.html" class="text-gray-700 hover:text-secondary font-medium">Каталог</a>
          <a href="#" class="text-gray-700 hover:text-secondary font-medium">Финансирование</a>
          <a href="#" class="text-gray-700 hover:text-secondary font-medium">О нас</a>
        </div>
        <div class="flex items-center">
          <button class="bg-secondary text-white px-4 py-2 rounded-md font-medium hover:bg-green-600 transition">
            Войти
          </button>
        </div>
      </div>
    </div>
  </nav>

  <!-- Карта -->
  <div id="map"></div>

  <!-- Фильтры поверх карты -->
  <div class="absolute top-24 left-4 z-10 bg-white p-4 rounded-lg shadow-lg">
    <div class="space-y-4">
      <div>
        <label class="block text-gray-700 mb-1 text-sm font-medium">Категория</label>
        <select id="category-filter" class="w-full px-3 py-2 border border-gray-300 rounded-md text-sm focus:ring-2 focus:ring-secondary focus:border-transparent">
          <option value="all">Все категории</option>
          <option value="housing">Жилая застройка</option>
          <option value="industry">Промышленность</option>
          <option value="tourism">Туризм</option>
          <option value="roadside">Придорожный сервис</option>
        </select>
      </div>
      <div>
        <label class="block text-gray-700 mb-1 text-sm font-medium">Бюджет, млн ₽</label>
        <select id="price-filter" class="w-full px-3 py-2 border border-gray-300 rounded-md text-sm focus:ring-2 focus:ring-secondary focus:border-transparent">
          <option value="all">Любой</option>
          <option value="0-50">До 50</option>
          <option value="50-150">50-150</option>
          <option value="150-300">150-300</option>
          <option value="300+">300+</option>
        </select>
      </div>
      <button id="apply-filters" class="w-full bg-secondary text-white py-2 rounded-md text-sm font-medium hover:bg-green-600 transition">
        Применить
      </button>
    </div>
  </div>

  <script>
    // Инициализация карты
    ymaps.ready(init);

    function init() {
      const map = new ymaps.Map('map', {
        center: [55.76, 37.64], // Москва
        zoom: 10
      });

      // Примеры объектов (в реальном приложении получать через API)
      const objects = [
        {
          id: 1,
          name: 'Земельный участок в Подмосковье',
          category: 'housing',
          price: 125,
          coordinates: [55.75, 37.62],
          address: 'Московская обл., 30 км от МКАД',
          image: 'https://static.photos/nature/200x200/1'
        },
        {
          id: 2,
          name: 'Промзона в Ленинградской обл.',
          category: 'industry',
          price: 85,
          coordinates: [59.95, 30.30],
          address: 'Ленинградская обл., 15 км от КАД',
          image: 'https://static.photos/industry/200x200/2'
        },
        {
          id: 3,
          name: 'Земля на берегу Финского залива',
          category: 'tourism',
          price: 210,
          coordinates: [60.10, 29.90],
          address: 'Ленинградская обл., Курортный район',
          image: 'https://static.photos/travel/200x200/3'
        }
      ];

      // Создание меток
      objects.forEach(obj => {
        const marker = new ymaps.Placemark(
          obj.coordinates,
          {
            hintContent: obj.name,
            balloonContent: `
              <div class="marker-info">
                <img src="${obj.image}" class="w-full h-32 object-cover rounded mb-2" alt="${obj.name}">
                <h4 class="font-bold">${obj.name}</h4>
                <p class="text-sm text-gray-600 mb-1">${obj.address}</p>
                <p class="text-sm mb-2">Цена: <span class="font-bold">${obj.price} млн ₽</span></p>
                <a href="project.html?id=${obj.id}" class="text-secondary text-sm font-medium hover:underline">Подробнее →</a>
              </div>
            `
          },
          {
            preset: 'islands#greenDotIcon'
          }
        );

        map.geoObjects.add(marker);
      });

      // Фильтрация объектов
      document.getElementById('apply-filters').addEventListener('click', () => {
        const category = document.getElementById('category-filter').value;
        const priceRange = document.getElementById('price-filter').value;

        map.geoObjects.removeAll();
        
        objects.filter(obj => {
          let match = true;
          
          if (category !== 'all' && obj.category !== category) match = false;
          
          if (priceRange !== 'all') {
            const price = obj.price;
            if (priceRange === '0-50' && price > 50) match = false;
            if (priceRange === '50-150' && (price <= 50 || price > 150)) match = false;
            if (priceRange === '150-300' && (price <= 150 || price > 300)) match = false;
            if (priceRange === '300+' && price <= 300) match = false;
          }
          
          return match;
        }).forEach(obj => {
          const marker = new ymaps.Placemark(obj.coordinates, {
            hintContent: obj.name,
            balloonContent: `
              <div class="marker-info">
                <img src="${obj.image}" class="w-full h-32 object-cover rounded mb-2" alt="${obj.name}">
                <h4 class="font-bold">${obj.name}</h4>
                <p class="text-sm text-gray-600 mb-1">${obj.address}</p>
                <p class="text-sm mb-2">Цена: <span class="font-bold">${obj.price} млн ₽</span></p>
                <a href="project.html?id=${obj.id}" class="text-secondary text-sm font-medium hover:underline">Подробнее →</a>
              </div>
            `
          }, {
            preset: 'islands#greenDotIcon'
          });

          map.geoObjects.add(marker);
        });
      });
    }

    // Инициализация иконок
    feather.replace();
  </script>
</body>
</html>