Поправил карту в фотораме

This commit is contained in:
Krivchikov Dmitry 2015-01-26 15:22:54 +03:00
parent 3adac2d50d
commit ff83fced0a
2 changed files with 10 additions and 9 deletions

View File

@ -38,21 +38,17 @@
<tr> <tr>
<td width="33%"></td> <td width="33%"></td>
<td width="34%"> <td width="34%">
<div class="fotorama" data-maxwidth="555" data-loop="true"> <div class="fotorama" data-width="534" data-height="400" data-loop="true">
<?php if ($point->img): ?> <?php if ($point->img): ?>
<a href="<?= $point->img ?>"> <img data-thumb="<?= $point->img ?>" src="<?= $point->img ?>">
<img src="<?= $point->img ?>" />
</a>
<?php endif; ?> <?php endif; ?>
<?php if ($photos): ?> <?php if ($photos): ?>
<?php foreach ($photos as $photo): ?> <?php foreach ($photos as $photo): ?>
<a href="/photos/middle/<?= $photo->name ?>"> <img data-thumb="/photos/small/<?= $photo->name ?>" src="/photos/middle/<?= $photo->name ?>">
<img src="/photos/small/<?= $photo->name ?>">
</a>
<?php endforeach; ?> <?php endforeach; ?>
<?php endif; ?> <?php endif; ?>
<span> <span>
<div id="map" style="width: 100%; height: 100%; position: relative; display: inline-block;"></div> <div id="map" style="width: 100%; height: 100%; position: static; display: block;"></div>
</span> </span>
</div> </div>
</td> </td>

View File

@ -90,7 +90,12 @@ function initPoints()
url: "/json/points/", url: "/json/points/",
success: function (data) { success: function (data) {
for (var k in data) { for (var k in data) {
markers.addLayer(constructPoint(data[k])); if (k == pointId) {
constructPoint(data[k]);
points[k].addTo(myMap);
} else {
markers.addLayer(constructPoint(data[k]));
}
} }
myMap.addLayer(markers); myMap.addLayer(markers);
} }