Revize 2221
Přidáno uživatelem David Raška před asi 11 roky(ů)
freenetis/branches/1.1/application/views/address_points/show.php | ||
---|---|---|
</table>
|
||
|
||
<?php if (!empty($gps)): ?>
|
||
<a href="http://maps.google.com/maps?f=q&hl=<?php echo $lang ?>&geocode=&q=<?php echo $gpsx ?>,<?php echo $gpsy ?>&z=18&t=h&ie=UTF8" target="_blank">
|
||
<a class="gmap" href="http://maps.google.com/maps?f=q&hl=<?php echo $lang ?>&geocode=&q=<?php echo $gpsx ?>,<?php echo $gpsy ?>&z=18&t=h&ie=UTF8" target="_blank">
|
||
<img alt="<?php echo __('Address point detail') ?>" src="http://maps.google.com/maps/api/staticmap?center=<?php echo $gpsx ?>,<?php echo $gpsy ?>&zoom=16&maptype=hybrid&size=400x300&markers=color:red%7C<?php echo $gpsx ?>,<?php echo $gpsy ?>&language<?php echo $lang ?>&sensor=false" style="float: right; margin-right: 10px;" />
|
||
</a>
|
||
<div style="margin-bottom: 10px; float:left"></div>
|
freenetis/branches/1.1/application/views/devices/show.php | ||
---|---|---|
</table>
|
||
|
||
<?php if (!empty($gps)): ?>
|
||
<a href="http://maps.google.com/maps?f=q&hl=<?php echo $lang ?>&geocode=&q=<?php echo $gpsx ?>,<?php echo $gpsy ?>&z=18&t=h&ie=UTF8" target="_blank">
|
||
<a class="gmap" href="http://maps.google.com/maps?f=q&hl=<?php echo $lang ?>&geocode=&q=<?php echo $gpsx ?>,<?php echo $gpsy ?>&z=18&t=h&ie=UTF8" target="_blank">
|
||
<img alt="<?php echo __('Address point detail') ?>" src="http://maps.google.com/maps/api/staticmap?center=<?php echo $gpsx ?>,<?php echo $gpsy ?>&zoom=18&maptype=hybrid&size=300x300&markers=color:red%7C<?php echo $gpsx ?>,<?php echo $gpsy ?>&sensor=false" style="float: right; margin-right: 10px;" />
|
||
</a>
|
||
<?php endif; ?>
|
freenetis/branches/1.1/application/views/js/__pieces/whisperer_gps.php | ||
---|---|---|
var map = '<img src="http://maps.google.com/maps/api/staticmap?center='+s[0]+','+s[1]+'&zoom=13&maptype=normal&size='+width+'x'+height+'&markers=color:red%7C'+s[0]+','+s[1]+'&language<?php echo Config::get('lang')?>&sensor=false"></img>';
|
||
map = '<div><a href="http://maps.google.com/maps?f=q&hl=<?php echo Config::get('lang') ?>&geocode=&q='+s[0]+','+s[1]+'&z=18&t=h&ie=UTF8" target="_blank">'+map+'</a></div>';
|
||
$("#ap_map").html(map);
|
||
map_add_zoom_buttons($("#ap_map a"), 6, 20);
|
||
}
|
||
}
|
||
else
|
||
... | ... | |
var map = '<img src="http://maps.google.com/maps/api/staticmap?center='+s[0]+','+s[1]+'&zoom=13&maptype=normal&size='+width+'x'+height+'&markers=color:red%7C'+s[0]+','+s[1]+'&language<?php echo Config::get('lang')?>&sensor=false"></img>';
|
||
map = '<div><a href="http://maps.google.com/maps?f=q&hl=<?php echo Config::get('lang') ?>&geocode=&q='+s[0]+','+s[1]+'&z=18&t=h&ie=UTF8" target="_blank">'+map+'</a></div>';
|
||
$("#domicile_ap_map").html(map);
|
||
map_add_zoom_buttons($("#domicile_ap_map a"), 6, 20);
|
||
}
|
||
}
|
||
else
|
freenetis/branches/1.1/application/views/js/base.php | ||
---|---|---|
}));
|
||
}
|
||
|
||
/**
|
||
* Adds zoom in and zoom out buttons after a map and set their events
|
||
*
|
||
* @param e Element to which buttons are added
|
||
* @param min Minimal zoom [optional - default 1]
|
||
* @param max Maximal zoom [optional - default not limited]
|
||
* @author David Raska
|
||
*/
|
||
function map_add_zoom_buttons(e, min, max)
|
||
{
|
||
if (min === undefined || isNaN(min))
|
||
{
|
||
min = 1;
|
||
}
|
||
|
||
if (max === undefined || isNaN(max))
|
||
{
|
||
max = undefined;
|
||
}
|
||
|
||
$(e).append('<div class="map_zoom_in" title="<?php echo __('Zoom in') ?>"></div>');
|
||
$(e).append('<div class="map_zoom_out" title="<?php echo __('Zoom out') ?>"></div>');
|
||
|
||
$(e).find('.map_zoom_in').click(function(){
|
||
var img = $(e).find('img');
|
||
|
||
var src = img.attr('src');
|
||
var re = new RegExp(/zoom=(\d*)/);
|
||
var zoom = src.match(re);
|
||
|
||
if (zoom && (max === undefined || zoom[1] < max))
|
||
{
|
||
src = src.replace(re, 'zoom='+(+zoom[1]+1).toString());
|
||
img.attr('src', src);
|
||
}
|
||
|
||
return false;
|
||
});
|
||
|
||
$(e).find('.map_zoom_out').click(function(){
|
||
var img = $(e).find('img');
|
||
|
||
var src = img.attr('src');
|
||
var re = new RegExp(/zoom=(\d*)/);
|
||
var zoom = src.match(re);
|
||
|
||
if (zoom && (min === undefined || zoom[1] > min))
|
||
{
|
||
src = src.replace(re, 'zoom='+(zoom[1]-1).toString());
|
||
img.attr('src', src);
|
||
}
|
||
|
||
return false;
|
||
});
|
||
}
|
||
|
||
$('.gmap').each(function (i, e)
|
||
{
|
||
map_add_zoom_buttons(e, 6, 20);
|
||
});
|
||
|
||
// sort unordered grids
|
||
$('table').tablesorter();
|
||
|
freenetis/branches/1.1/media/css/style.css | ||
---|---|---|
position: absolute;
|
||
}
|
||
|
||
#ap_map div,
|
||
#domicile_ap_map div {
|
||
#ap_map > div,
|
||
#domicile_ap_map > div {
|
||
position: absolute;
|
||
bottom: 0px;
|
||
left: 210px;
|
||
... | ... | |
background: url('../images/icons/map_icon.gif') #F1F1F1 no-repeat center center;
|
||
width: 233px;
|
||
height: 104px;
|
||
}
|
||
|
||
.gmap {
|
||
position: absolute;
|
||
right: 0;
|
||
}
|
||
|
||
div.map_zoom_in {
|
||
position: absolute;
|
||
left: 5px;
|
||
top: 5px;
|
||
cursor: pointer;
|
||
width: 10px;
|
||
height: 10px;
|
||
background-image: url('../images/icons/ico_math_plus.gif');
|
||
}
|
||
|
||
div.map_zoom_out {
|
||
position: absolute;
|
||
left: 5px;
|
||
top: 20px;
|
||
cursor: pointer;
|
||
width: 10px;
|
||
height: 10px;
|
||
background-image: url('../images/icons/ico_math_minus.gif');
|
||
}
|
Také k dispozici: Unified diff
Novinky:
- closes #790: Pridani tlacitek pro priblizeni a oddaleni mapy pomoci tridy .gmap