37 lines
1.8 KiB
PHP
37 lines
1.8 KiB
PHP
<?
|
|
if ( isset( $this -> _adress ) )
|
|
{
|
|
?>
|
|
<script src='http://maps.google.com/maps?file=api&v=2&key=<?=$this -> _google_map_key;?>' type='text/javascript'></script>
|
|
<script type='text/javascript'>
|
|
$(document).ready(function() {
|
|
map_<?=$this -> _id;?> = new GMap2(document.getElementById('mapa_<?=$this -> _id;?>'));
|
|
var geo_<?=$this -> _id;?> = new GClientGeocoder();
|
|
var adres_<?=$this -> _id;?> = '<?=$this -> _adress;?>';
|
|
geo_<?=$this -> _id;?>.getLatLng(adres_<?=$this -> _id;?>,function(punkt_<?=$this -> _id;?>){
|
|
map_<?=$this -> _id;?>.setCenter(punkt_<?=$this -> _id;?>, <?=$this -> _zoom;?> );
|
|
map_<?=$this -> _id;?>.addOverlay(new GMarker(punkt_<?=$this -> _id;?>));
|
|
map_<?=$this -> _id;?>.panTo(punkt_<?=$this -> _id;?>);
|
|
map_<?=$this -> _id;?>.setUIToDefault();
|
|
});
|
|
});
|
|
</script>
|
|
<div id='mapa_<?=$this -> _id;?>' style='width:<?=$this -> _width;?>px; height:<?=$this -> _height;?>px; border:1px solid black;'></div>
|
|
<?
|
|
}
|
|
else
|
|
{
|
|
?>
|
|
<script src='http://maps.google.com/maps?file=api&v=2&key=<?=$this -> _google_map_key;?>' type='text/javascript'></script>
|
|
<script type='text/javascript'>
|
|
$(document).ready(function() {
|
|
map_<?=$this -> _id;?> = new GMap2(document.getElementById('mapa_<?=$this -> _id;?>'));
|
|
var point_<?=$this -> _id;?> = new GLatLng(<?=$this -> _x_coord;?>,<?=$this -> _y_coord;?>);
|
|
map_<?=$this -> _id;?>.setCenter(point_<?=$this -> _id;?> , <?=$this -> _zoom;?> );
|
|
map_<?=$this -> _id;?>.addOverlay(new GMarker(point_<?=$this -> _id;?>));
|
|
map_<?=$this -> _id;?>.setUIToDefault();
|
|
});
|
|
</script>
|
|
<div id='mapa_<?=$this -> _id;?>' style='width:<?=$this -> _width;?>px; height:<?=$this -> _height;?>px; border:1px solid black;'></div>
|
|
<?
|
|
}
|