Autor Zpráva
pinlop
Profil
Zdravím. Potřeboval bych vytvořit toto ale bohužel nevím jak : http://www.jdisebavit.cz/seznam-restaurace/

Potřebuji vytvořit mapu (i s možností zadání adresy), na kterou když kliknu, tak se mi načte do php požadovaná gsp souřadnice,nebo tedy do odkazu.
MyShare
Profil
Nazdar ...
Hádam to pomôže

HTML

<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="style.css">
 <script type="text/javascript" src="http://www.jdisebavit.cz/js/jquery.js"></script>
 <script type="text/javascript" src="http://www.jdisebavit.cz/js/jquery_ui.js"></script>
 <script type="text/javascript" src="http://www.jdisebavit.cz/js/jquery.lightbox-0.5.pack.js"></script>
</head>
<body>

<script src="http://maps.google.com/maps/api/js?sensor=false&amp;key=AIzaSyDDbtQ7SPOGw0L-3SYFcPAwoy2kig0jBiY" type="text/javascript"></script>
<div id="main2">
<h1>H1 Názov</h1>
    <div id="vychozipozice" class="brand" >
        <div id="vychozi_mapa"></div>
        <div class="adresa">
            <strong>Výberte místo přímo v mapě nebo zadejte ulici!</strong>
            <form name="yvch" id="form_vych" onsubmit="return false;">
            <input type="text" class="in_adresa" name="adresa" value="" />
            <input type="submit" class="in_adresa_send" name="send" value="Najít"/>
            </form>
        </div>
    </div>
    <script type="text/javascript">
    //<![CDATA[

var okruh=2;
var u_filtry="";
var map;
var marker;
var infowindow;
var alocation="";

var geocoder = new google.maps.Geocoder();
var u_vychozi="";
var typ="icon_restaurace";
var hash=window.location.hash;

if(hash!=''){
    var html=$.ajax({type:"POST",url:"/soubory/ajax/planovani.php",data:"typ=nastav&"+hash.replace("#!",""),async:false,dataType:"json"}).responseText;
    if(html==1){window.location.reload();}
}else{
    var html = $.ajax({    type:"POST",url:"/soubory/ajax/planovani.php",data:"typ=vymaz",async:false,dataType:"json"}).responseText;
    if(html==1){window.location.reload();}
}

function uprav_url(){
    window.location.replace("#!v="+u_vychozi+"&p=&o="+okruh+"&f="+u_filtry);
}

$("#slider-okruh").slider({value:okruh,min:1,max:20,step:1,range:"min",slide:function(event,ui){$(".max.okruh").empty().append("<strong>"+ui.value+"</strong>km");}});
$("#slider-okruh").live("slidechange click",function(){okruh=$("#slider-okruh").slider("value");uprav_url();vypis(u_vychozi,typ);    });
$(".max.okruh").empty().append("<strong>"+okruh+"</strong>km");

$(".filtr").change(function(){
    if($(this).is(':checked')){
//        alert(ddd);
        if(u_filtry==""){u_filtry=$(this).val();}else{u_filtry=u_filtry+","+$(this).val();}
        uprav_url();
    }else{
        u_filtry=u_filtry.replace(","+$(this).val()+",",",").replace($(this).val()+",","").replace(","+$(this).val(),"").replace($(this).val(),"");
        uprav_url();
    }
    vypis(u_vychozi,typ);
});

var myOptions={zoom:12,center:new google.maps.LatLng(50.087811,14.420462),mapTypeId:google.maps.MapTypeId.ROADMAP}
map = new google.maps.Map(document.getElementById("vychozi_mapa"), myOptions);

google.maps.event.addListener(map,'click',function(event){pridej_marker(event.latLng);});
function pridej_marker(location) {
    geocoder.geocode({'latLng': location}, function(results, status) {
      if(status==google.maps.GeocoderStatus.OK) {
        map.setCenter(results[0].geometry.location);
        if(marker==null){
            marker = new google.maps.Marker({
                map: map,
                position: results[0].geometry.location
            });
            infowindow = new google.maps.InfoWindow({
                content:'<div style="height:80px"><b>Hledat v okolí:</b><br>'+
                    results[0].address_components[2].long_name+' '+
                    results[0].address_components[1].long_name+'/'+
                    results[0].address_components[0].long_name+'<a class="potvrdit_adresu">Potvrdit</a></div>',
                position: results[0].geometry.location
            });
        }else{
            infowindow.close();
            marker.setPosition(results[0].geometry.location);
            infowindow.setPosition(results[0].geometry.location);
            infowindow.setContent('<div style="height:80px"><b>Výchozí pozice:</b><br>'+
                results[0].address_components[2].long_name+' '+
                results[0].address_components[1].long_name+'/'+
                results[0].address_components[0].long_name+'<a class="potvrdit_adresu">Potvrdit</a></div>');

        }
        alocation=results[0].geometry.location;
        u_vychozi=alocation;
        uprav_url();
        infowindow.open(map);
        map.setCenter(results[0].geometry.location);
      }
    });
}

$(".in_adresa_send").click(function(){
    address=$(".in_adresa").val() + ' Česká republika';
      geocoder.geocode({'address':address},function(results, status) {
      if (status == google.maps.GeocoderStatus.OK) {
          pridej_marker(results[0].geometry.location);
      }else{
          alert("Zadaná adresa nenalezena!");
      }
    });

});
$(".potvrdit_adresu").live("click",function(){
    var html = $.ajax({    type:"POST",url:"/soubory/ajax/planovani.php",data:"typ=vychozibod&gps="+alocation,
                        async:false,dataType:"json"}).responseText;
    var obj = jQuery.parseJSON(html);
    if(obj.stav=='ok'){
        $(".potvrdit_adresu").hide();
        $("#vychozipozice").slideUp("slow",function(){
            $(".brand").hide();
            $("#vypis").slideDown("slow");
            uprav_url();
            vypis(u_vychozi,typ);
        });
    }else{alert(html);}
});




function vypis(ap,type){
    var h=window.location.hash;
    var html = $.ajax({type:"POST",url:"/soubory/ajax/vypis.php",
    data:"bod="+ap+"&typ="+type+"&"+h.replace("#!","")
    ,async:false}).responseText;
    $("#vypis2").empty().append(html);
}
//]]>
</script>

</div>
</div>

</body>
</html>

CSS

[pre]
#vychozipozice{display:block;}
#vychozipozice #vychozi_mapa{width:786px;height:300px;border:1px solid #CCC;margin:8px 0;}
#vychozipozice .adresa{width:788px;height:57px;background:url("http://www.jdisebavit.cz/img/bg_adresa.jpg");position:relative;}
#vychozipozice .adresa strong{font-size:17px;color:#fff;position:relative;top:17px;left:20px;}
#vychozipozice .adresa .in_adresa{border:1px solid #1D1D52;width:200px;height:23px;position:absolute;top:15px;left:470px;}
#vychozipozice .adresa .in_adresa_send{width:94px;height:25px;position:absolute;top:15px;left:680px;background:url("/img/bg_adresa_odeslat.jpg");border:0;color:#FFF;font-weight:700;}
#vychozipozice .potvrdit_adresu{width:94px;height:25px;display:block;position:relative;left:0px;top:10px;background:url(http://www.jdisebavit.cz/img/bg_adresa_odeslat.jpg);border:0;color:#FFF;font-weight:700;line-height:25px;text-align:center;}

#vyber_druhu,.fields{display:none;padding:10px;border:1px solid #CCC;margin-top:10px;}
#vyber_druhu li{list-style:none;float:left;margin-left:10px;}
#vyber_druhu li a{display:block;width:130px;height:40px;line-height:40px;padding-left:50px;font-weight:700;font-size:15px;color:#29297C;margin-bottom:5px;}
#vyber_druhu li a.icon_restaurace{background:#E4E4E4 url("http://www.jdisebavit.cz/img/icon_restaurace.png") no-repeat;}
#vyber_druhu li a.icon_bary{background:#E4E4E4 url("http://www.jdisebavit.cz/img/icon_bary.png") no-repeat;}
#vyber_druhu li a.icon_hudebni-kluby{background:#E4E4E4 url("http://www.jdisebavit.cz/img/icon_hudebni-kluby.png") no-repeat;}
#vyber_druhu li a.icon_kulturni-mista{background:#E4E4E4 url("http://www.jdisebavit.cz/img/icon_kulturni-mista.png") no-repeat;}
#vyber_druhu li a.icon_pro-dospele{background:#E4E4E4 url("http://www.jdisebavit.cz/img/icon_pro-dospele.png") no-repeat;}
#vyber_druhu li a:hover{background-position:0 -50px;background-color:#333397;color:#C3C3C3}


#vypis{display:none;padding-top:10px;}
#vypis .filtry{width:180px;background:#F3F3F3;float:left;margin-top:3px;border:1px solid #999;margin-right:3px;}
#vypis #vypis2{float:left;}

#vypis .vypis_small{height:120px;background:#F3F3F3;border:1px solid #999;margin:3px 0;padding:5px;width:590px;}
#vypis .vypis_small .logo{border:1px solid #ccc;width:150px;height:80px;float:left;overflow:hidden;}
#vypis .vypis_small .logo img{width:150px;}
#vypis .vypis_small .telo{float:left;border-right:1px solid #999;width:300px;height:80px;overflow:hidden;position:relative;}
#vypis .vypis_small .telo .likebox{position:absolute;top:5px;left:200px;}
#vypis .vypis_small .telo h2{font-size:16px;font-weight:700;margin:0 10px 5px 10px;color:#2F2E84;}
#vypis .vypis_small .telo p{line-height:17px;color:#666;margin:0 10px;}
#vypis .vypis_small .prava {float:left;text-align:center;}
#vypis .vypis_small .prava .pridat_k_trase{display:block;width:118px;height:25px;background:url("/img/add_k_trase.jpg");margin-left:10px;margin-bottom:10px;}
#vypis .vypis_small .prava .alt_pridat_k_trase{display:block;width:118px;height:25px;margin-left:10px;margin-bottom:10px;}
#vypis .vypis_small .prava .pridat_k_trase:hover{background-position:0px -25px;}
#vypis .vypis_small .prava p{font-size:14px;color:#666666;}
#vypis .vypis_small .prava p strong{font-size:19px;color:#2D2C84;}
#vypis .vypis_small hr{border:0px;border-top:1px solid #999}
#vypis .vypis_small .b_middle{width:450px;float:left;height:20px;text-align:right;}
#vypis .vypis_small .b_middle img{margin:0 3px;}
#vypis .vypis_small .b_right{float:left;}
#vypis .vypis_small .b_right .vice_o_podnik{display:block;width:121px;height:25px;background-image:url("/img/vice_o_podniku.jpg");margin-left:10px;margin-bottom:10px;}
#vypis .vypis_small .b_right .vice_o_podnik:hover{background-position:0px -25px;}
#vypis .vypis_small .b_right .info_o_podnik{display:block;width:121px;height:25px;background-image:url("/img/info_o_podniku.jpg");margin-left:10px;margin-bottom:10px;}
#vypis .vypis_small .b_right .info_o_podnik:hover{background-position:0px -25px;}

#vypis .podnik{display:none;border:1px solid #999;padding:5px;margin-top:-8px;background:#F7F7F7}
#vypis .podnik .popis{width:445px;border-right:1px solid #E4E4E4;border-bottom:1px solid #E4E4E4;padding-right:5px;}
#vypis .podnik .popis ul{margin-left:20px;}
#vypis .podnik .popis .akce{color:#D50055;font-size:12px;font-weight:700;}

#vypis .podnik .adresa{width:445px;float:left;padding-left:5px;padding-top:3px;border-right:1px solid #E4E4E4;border-bottom:1px solid #E4E4E4;}
#vypis .podnik .adresa div{float:left;height:40px;}
#vypis .podnik .adresa .mapa a{width:132px;height:23px;background-image:url("http://www.jdisebavit.cz/img/zobrazit_na_mape.jpg");display:block;color:#FFF;padding-top:6px;padding-left:5px;margin-top:5px;margin-left:50px;}
.startod{width:

Vaše odpověď


Prosím používejte diakritiku a interpunkci.

Ochrana proti spamu. Napište prosím číslo dvě-sta čtyřicet-sedm: