Projekt

Obecné

Profil

« Předchozí | Další » 

Revize a9be340b

Přidáno uživatelem Ondřej Fibich před více než 5 roky(ů)

Issue #1113: Fix display of address point map in popup

Zobrazit rozdíly:

application/controllers/members.php
$view->title = $title;
$view->breadcrumbs = $breadcrumbs->html();
$view->action_logs = action_logs::object_last_modif($member, $member_id);
$view->mapycz_enabled = TRUE; // for popup link to address point
$view->content = new View('members/show');
$view->content->title = $title;
$view->content->member = $member;
application/views/address_points/show.php
?>
<br /><br />
<table class="extended" style="float:left; margin-bottom: 20px;" cellspacing="0">
<div style="display: grid; grid-column-gap: 50px; grid-template-columns: 1fr 2fr; margin-bottom: 2em">
<table class="extended" cellspacing="0">
<tr>
<th><?php echo __('ID') ?></th>
<td><?php echo $address_point->id ?></td>
......
</table>
<?php if (!empty($gps)): ?>
<div id="ap_gmap" style="float: <?php echo ($this->popup ? 'left' : 'right'); ?>; width:500px; height:300px"></div>
<div style="margin-bottom: 10px; float:left"></div>
<script type="text/javascript">
$(document).ready(function () {
mapycz_addr('ap_gmap', <?php echo $gpsx ?>, <?php echo $gpsy ?>);
});
</script>
<div id="ap_gmap" style="min-height: 400px" data-gpsx="<?php echo $gpsx ?>" data-gpsy="<?php echo $gpsy ?>"></div>
<?php endif; ?>
<div style="clear: both"></div>
<br /><br />
</div>
<h3><?php echo __('Members on this address') ?></h3>
<?php echo $members_grid ?>
application/views/devices/show.php
<br />
<br />
<table class="extended" cellspacing="0" style="float:left; width: 400px; word-wrap: break-word;">
<div style="display: grid; grid-column-gap: 50px; grid-template-columns: 400px auto;">
<table class="extended" cellspacing="0" style="word-wrap: break-word;">
<tr>
<th><?php echo __('Device ID') ?></th>
<td><?php echo $device->id ?></td>
......
</table>
<?php if (!empty($gps)): ?>
<div id="ap_gmap" style="float: <?php echo ($this->popup ? 'left' : 'right');?>; width:400px;height:300px;">
<div id="ap_gmap">
</div>
<script type="text/javascript">
$(document).ready(function () {
......
</script>
<?php endif; ?>
<br class="clear" />
<br />
</div>
<br />
<br />
<?php if ($this->acl_check_view('Ifaces_Controller', 'iface', $device->user->member_id)): ?>
application/views/js/address_points_show.php
<?php
/**
* Map in address point detail.
* Map in address point detail, coordinate loaded from data attributes.
*
* @author Ondřej Fibich
*/
......
if (FALSE): ?><script type="text/javascript"><?php endif
?>
window.mapycz_addr = function (divId, gpsx, gpsy)
$(document).ready(function ()
{
var center = SMap.Coords.fromWGS84(gpsy, gpsx);
var m = new SMap(JAK.gel(divId), center, 17);
m.addDefaultLayer(SMap.DEF_OPHOTO);
m.addDefaultLayer(SMap.DEF_BASE).enable();
function mapycz_addr(divId, gpsx, gpsy)
{
var center = SMap.Coords.fromWGS84(gpsy, gpsx);
var m = new SMap(JAK.gel(divId), center, 17);
m.addDefaultLayer(SMap.DEF_OPHOTO);
m.addDefaultLayer(SMap.DEF_BASE).enable();
var layerSwitch = new SMap.Control.Layer();
layerSwitch.addDefaultLayer(SMap.DEF_BASE);
layerSwitch.addDefaultLayer(SMap.DEF_OPHOTO);
m.addControl(layerSwitch, {left: "8px", top: "9px"});
m.addControl(new SMap.Control.Sync());
m.addDefaultControls();
var layerSwitch = new SMap.Control.Layer();
layerSwitch.addDefaultLayer(SMap.DEF_BASE);
layerSwitch.addDefaultLayer(SMap.DEF_OPHOTO);
m.addControl(layerSwitch, {left: "8px", top: "9px"});
m.addDefaultControls();
var markerLayer = new SMap.Layer.Marker();
markerLayer.addMarker(new SMap.Marker(center, "myMarker", {}));
m.addLayer(markerLayer);
markerLayer.enable();
};
var markerLayer = new SMap.Layer.Marker();
markerLayer.addMarker(new SMap.Marker(center, "myMarker", {}));
m.addLayer(markerLayer);
markerLayer.enable();
};
var $map = $('#ap_gmap');
mapycz_addr('ap_gmap', $map.data('gpsx'), $map.data('gpsy'));
});
application/views/js/devices_show.php
{
var center = SMap.Coords.fromWGS84(gpsy, gpsx);
var m = new SMap(JAK.gel(divId), center, 17);
m.addDefaultLayer(SMap.DEF_OPHOTO);
m.addDefaultLayer(SMap.DEF_BASE).enable();
var layerSwitch = new SMap.Control.Layer();
layerSwitch.addDefaultLayer(SMap.DEF_BASE);
layerSwitch.addDefaultLayer(SMap.DEF_OPHOTO);
m.addControl(layerSwitch, {left: "8px", top: "9px"});
m.addControl(new SMap.Control.Sync());
m.addDefaultControls();
var markerLayer = new SMap.Layer.Marker();

Také k dispozici: Unified diff