ŽabkaPoint jako Google mapa

V článku Jednoduchý způsob, jak umožnit zákazníkům dopravu ŽabkaPoint ukazujeme, jak pomocí jednoduchého PHP kódu umístit do nákupního košíku jednoduchou rolovací lištu. V tomto článku najdete návod, jak umožnit zákazníkovi výběr cílového místa v Google mapě. 

Výsledek by měl vypadat přibližně takto: 

Interaktvivní Google mapa

Interaktvivní Google mapa

Zákazník může cílovou prodejnu vybírat v rolovací liště nahoře nebo kliknutím na nejbližší místo do mapy. Aby příklad fungoval nastavte na serveru (nebo požádejte webhosting) o povolení allow_url_fopen. 

Kvůli interaktivitě je kód trochu obsáhlejší. Příklad si můžete prohlédnout a vyzkoušet zde

<script type='text/javascript' src='http://maps.google.com/maps/api/js?sensor=true'></script>
<Script> 

var map;

var infowindow;

<?php

function DMStoDEC($deg,$min,$sec)
{
    return $deg+((($min*60)+($sec))/3600);
} 
$js_bubbles  = "";
$drd_options = "";

  $xml = simplexml_load_file("http://www.zabkapoint.cz/data/db_shop.xml");
{
        foreach($xml->database->table as $SHOP){
    if($SHOP->column[6]){

     $id = $SHOP->column[0];
   $gg1 = explode(",", $SHOP->column[6]);

   $ggn = explode(" ", trim($gg1[0]));

   $lat = DMStoDEC((int)trim($ggn[0]), (int)trim($ggn[1]), (int)trim($ggn[2]));

   $gge = explode(" ", trim($gg1[1]));
   $lon = DMStoDEC((int)trim($gge[0]), (int)trim($gge[1]), (int)trim($gge[2]));
   $title = $SHOP->column[2].", ".$SHOP->column[5];
echo "
     var bubble_$id   = '".$title."';\n
     var lat_$id   = '".$lat."';\n
     var lon_$id   = '".$lon."';\n
     var title_$id = '".$title."';\n
";   

$js_bubbles .= "
     markerBubble('$id', '0');
";
$drd_options .= "<option value=\"$id\">".$title."</option>\n";
    }
   }
echo " 
function initialize() {
  var myLatlng = new google.maps.LatLng(50.095711,14.492962);
  var myOptions = {
    zoom: 11,
    center: myLatlng,
    mapTypeId: google.maps.MapTypeId.ROADMAP
  }

  map = new google.maps.Map(document.getElementById('map_canvas'), myOptions);

  ".$js_bubbles."
}

function markerBubble(idd, show_bubble) {
 var myselect=document.getElementById('drd_addresses');

 eval('var lat = lat_'+idd);
 eval('var lon = lon_'+idd);
 eval('var title = title_'+idd);
 eval('var bubble = bubble_'+idd);

    var location = new google.maps.LatLng(lat, lon);
    var marker2   = new google.maps.Marker({
        position: location,
        map: map
    });

  if (infowindow){
   infowindow.close();
  }

  infowindow = new google.maps.InfoWindow(
      { content: bubble,
        size: new google.maps.Size(50,50)
      });
  google.maps.event.addListener(marker2, 'click', function() {
    infowindow.content = bubble;
    infowindow.open(map,marker2);

  for (var i=0; i<myselect.options.length; i++){
   if (myselect.options[i].selected == true){
    myselect.options[i].selected = false;
    break;
   }
  }

  for (var i=0; i<myselect.options.length; i++){
   if (myselect.options[i].value == idd){
    myselect.options[i].selected = true;
    break;
   }
  }
  });

  if(show_bubble == '1'){
   infowindow.open(map,marker2);
  }else{
  }
}

</script>    
";
 }
?>

<table width="400">
  <tr>
    <td width="30%">
      <a href='http://www.zabkapoint.cz/' target=_blank>
        <img src="http://www.zabkapoint.cz/logo.png" width="94" height="16" border="0"></a>   </td>
    <td width="70%">
      <font face="Arial" color="#999999" size="-2">Služba ŽabkaPoint - výdej v provozovnách Žabka 6 - 23 hod.&nbsp;(<a href='
javascript: void(0)\'
   onclick="window.open('http://www.zabkapoint.cz/explain.php',
  'windowname1',
  'width=372, height=526');
   return false;">více informací</a>)&nbsp;&nbsp;&nbsp;Vyberte prodejnu:</font><br />
      <select name="zp_id" id="drd_addresses" onchange="markerBubble(this.value, '1')">
      <? echo $drd_options;?>
      </select>
    </td>
  </tr>  
  <tr>
    <td colspan="2">
      <?echo "<div id='map_canvas' style='border:0px solid; padding:0; margin:0; width:400px; height:300px'></div>";?>
    </td>
  </tr>
</table>               
<script>initialize();</script>

This entry was posted on Tuesday, January 18th, 2011 at 1:13 pm and is filed under Uncategorized. You can follow any responses to this entry through the RSS 2.0 feed. Responses are currently closed, but you can trackback from your own site.

45 Responses to “ŽabkaPoint jako Google mapa”

  1. Rayford Krefft Says:

    Hey there, I think your site might be having browser compatibility issues. When I look at your website in Chrome, it looks fine but when opening in Internet Explorer, it has some overlapping. I just wanted to give you a quick heads up! Other then that, excellent blog!

  2. Lorsoreock Says:

    Cheapeast Bentyl Direct Worldwide With Free Shipping Cheap Bentyl With Overnight Delivery [url=http://doxamed.com]generic levitra professional 20 mg[/url] Buy Kamagra Next Day Delivery Cialis Online Master Card Buy Celebrex [url=http://caslp1.com]Cheap Cialis[/url] No Pain Tooth Infection And Amoxicillin Asthmahaler Mist Buy Long Term Amoxicillin [url=http://uspapz.com]Cheap Viagra[/url] Pdr Cephalexin Liquid Venta De Kamagra Online [url=http://drugs2k.net]cialis[/url] Priligy Approved Countries Levitra En Streaming Zithromax Sexually Transmitted Infections Kamagra Jelly Schweiz [url=http://drugsly.com]buy viagra[/url] Clomid Cent Purchase Sildenafil Citrate Comprar Viagra Generico Por Telefono [url=http://bdnpn.com]cialis[/url] Prix Comprime Cialis Purchasing Discount Zentel In Internet With Free Shipping Orlistat 120 Mg Efectos Cialis 10 [url=http://call4ph.com]viagra online prescription[/url] Accutane Online Pharmacy Uk Ou Acheter Du Viagra Forum [url=http://frensz.com]buy viagra[/url] The Effects Of 500mg Amoxicillin Viagra Temps Levaquin In Germany Internet Pharmacy Without Perscription [url=http://eclatrx.com]kamagra soft tab[/url] Lilly Cialis Kaufen Levitra 20mg Preis 12 Stuck Viagra Online Purchase Usa Viagra belgique prix [url=http://gaprap.com]viagra online[/url] need isotretinoin isotret best website overseas Utilizzo Di Kamagra Buy Tadacip Cipla Prix Du Amoxicillin En Suisse [url=http://drugseo.com]viagra vs cialis vs levitra reviews[/url] Viagra Non Fa Male Cephalexin Product Viagra 100 Mg Comprime Cialis Espana Achat Kamagra Oral Jelly Buy Synthroid Using Paypal [url=http://bneatar.com]cialis[/url] Levitra Rezeptfrei Niederlande Order Prevacid Otc Levitra In Canada Discount Code Vente Cialis Pharmacie Cheapviagrarx [url=http://drugssu.com]levitra 40 mg generic[/url] Kamagra Pharma Bentyl Coligon Pharmacy 40 Mg Cialis Generica Cialis [url=http://ciaolis.com]cialis buy online[/url] Buy Low Cost Dapoxetine Pills Buy Wellbutrin Overnight Shipping Costo Del Propecia for sale isotretinoin acutane pills pharmacy with free shipping [url=http://o-drugs.com]priligy dapoxetine online drugstore[/url] Precio Cialis Farmacia Andorra

  3. Lizbeth Raffaele Says:

    Wonderful post! We are linking to this particularly great post on our site. Keep up the good writing.

  4. Lorsoreock Says:

    Viagra Without Prescriptions Where Can I Buy Methotrexate Levitra Horschaden [url=http://bestedmedrxfor.com]viagra[/url] Viasek Best Deal On Silagra Amoxicillin Long Term Effects [url=http://buyoxys.com]best price on levitra[/url] What Does Cialis For Daily Use Cost 105 Viagra Preis Osterreich Trusted Tablets Viagra Bestellung Viagra Soft Sildenafil 100mg 30 Pills [url=http://bakgol.com]viagra a paris en saint-paul[/url] Cost Of Viagra Pills Cipro Without Prescription isotretinoin 10mg [url=http://aspills.com]Cheap Cialis[/url] Lasix Netherlands 100mg Viagra For Sale

  5. Lorsoreock Says:

    Priligy Ficha Tecnica [url=http://fair-rx.com]cheapest kamagra[/url] Aldactone Order Synthroid 125 Mcg Online Generic Viagracanada Bay Viagra Cials [url=http://drisdol.com]cialis[/url] Viagra Uk Cual Es La Mejor Viagra Buy Xenical Nz Cialis Overnight [url=http://dmdrugs.com]viagra online[/url] Finpecia Canada Cialis Comparatif Prix Costo Levitra [url=http://ciaolis.com]cialis[/url] Pfizer Viagra Price Amoxil For Stomach Infections Propecia Hair Loss Treatment For Women Direct Online Stendra Avanafil Medicine Internet Overseas Shop [url=http://drugssu.com]order levitra without a prescription[/url] Cialis Non Funziona Che Fare What Is Cephalexin For Doxycycline In Internet Cialis 20 Mg Espana When Will Dapoxetine Sera Disponible? [url=http://byrxbox.com]viagra online pharmacy[/url] Keflex Cephalexin Generique Levitra Viagra Viagra generique belgique Orlistat Availabilty? Rezeptfrei Cialis [url=http://feldene.net]viagra[/url] Viagra Cheap Sold In Us Propecia O Avidart Viagra Acquisto Online Impact Of Amoxicillin Viagra Y Alcohol [url=http://crdrugs.com]cialis online pharmacy[/url] Viagra Aux Encheres Ajanta Pharma Generic Viagra Buy Brand Cialis [url=http://binotal.com]viagra online[/url] Compra Finasteride Propecia Viagra Junge Manner Stendra Buy Best Website [url=http://rx2day.com]buy viagra[/url] Online Overnight Pharmacy Kamagra Canada Vendita Amoxicillin Virus Maculopapular Canadian Pharmacy Propecia Viagra E Metabolismo [url=http://cidovir.com]online pharmacy[/url] Levitra Walmart $9 buy accutane online reviews Cialis En Las Mujeres Priligy Portugal [url=http://igf-lr3.com]cialis price[/url] Cialis Langzeitfolgen Cialis Online Pharmacy Discovering Amoxil Levitra Natur [url=http://etaze.net]comprar cialis online paypal[/url] Viagra Levitra Et Cialis Synthyroid Without A Prescription [url=http://frigra.com]Buy Cialis[/url] Cheap Zithromax Uk Can Keflex Antibiotic Cause Nightmares Daily Cialis Without Prescription [url=http://rx-best.com]cialis online[/url] Propecia Success Story Cialis Boite De 8 [url=http://buyoxys.com]viagra vs cialis vs levitra samples[/url] Canadian No Script Pharmacy Viagra Sur La Sante Generic Secure Amoxicilina For Sale Internet With Free Shipping Myambutol Sildenafil Sans Prescription [url=http://cpsmeds.com]buy cialis[/url] Keflex Dose Wound Infection Cialis Et Nebilox Generique Cialis [url=http://4rxday.com]Buy Cialis[/url] Priligy Dosage Instructions Genaric Viagra Retailers In Canada Achat Propecia Levitra Generico Online Vendita [url=http://o-drugs.com]priligy in sri lanka[/url] Priligy Generico En Mexico Ciplactin Pills Precios Cialis Alicante Kamagra Vente Libre France Generic Real Provera Medication Best Website Fedex [url=http://doxamed.com]levitra 20mg prices[/url] Cialis Para Eyaculacion Precoz Nuit Cialis Amoxicillin Msds

  6. Hong Crocco Says:

    I really like your writing style, great information, regards for posting : D.

  7. Barnypok Says:

    dcfk9I http://www.FyLitCl7Pf7ojQdDUOLQOuaxTXbj5iNG.com

  8. Barnypok Says:

    ZWA609 http://www.FyLitCl7Pf7ojQdDUOLQOuaxTXbj5iNG.com

  9. Barnypok Says:

    eWTt0S http://www.FyLitCl7Pf7ojQdDUOLQOuaxTXbj5iNG.com

  10. Barnypok Says:

    2gmCxZ http://www.FyLitCl7Pf7ojQdDUOLQOuaxTXbj5iNG.com

  11. Barnypok Says:

    xMWYGI http://www.FyLitCl7Pf7ojQdDUOLQOuaxTXbj5iNG.com

  12. Barnypok Says:

    jazQK9 http://www.FyLitCl7Pf7ojQdDUOLQOuaxTXbj5iNG.com

  13. Barnypok Says:

    ymk8gQ http://www.FyLitCl7Pf7ojQdDUOLQOuaxTXbj5iNG.com

  14. Barnypok Says:

    AZN6v2 http://www.FyLitCl7Pf7ojQdDUOLQOuaxTXbj5iNG.com

  15. Barnypok Says:

    Hbv5E6 http://www.FyLitCl7Pf7ojQdDUOLQOuaxTXbj5iNG.com

  16. Lenard Altenbach Says:

    Hi! I’m at work surfing around your blog from my new apple iphone! Just wanted to say I love reading your blog and look forward to all your posts! Carry on the fantastic work!

  17. Barnypok Says:

    hJZ8qa http://www.FyLitCl7Pf7ojQdDUOLQOuaxTXbj5iNG.com

  18. Barnypok Says:

    4LBzrE http://www.FyLitCl7Pf7ojQdDUOLQOuaxTXbj5iNG.com

  19. JimmiXzS Says:

    1a5JBa http://www.FyLitCl7Pf7ojQdDUOLQOuaxTXbj5iNG.com

  20. Jaymie Hilovsky Says:

    Awesome blog you have here but I was wanting to know if you knew of any discussion boards that cover the same topics discussed here? I’d really love to be a part of group where I can get feed-back from other experienced individuals that share the same interest. If you have any suggestions, please let me know. Appreciate it!

  21. Teodora Higbee Says:

    I was curious if you ever considered changing the structure of your website? Its very well written; I love what youve got to say. But maybe you could a little more in the way of content so people could connect with it better. Youve got an awful lot of text for only having one or 2 pictures. Maybe you could space it out better?

  22. Gregg Gofman Says:

    This design is spectacular! You obviously know how to keep a reader entertained. Between your wit and your videos, I was almost moved to start my own blog (well, almost…HaHa!) Excellent job. I really enjoyed what you had to say, and more than that, how you presented it. Too cool!

  23. Zachariah Says:

    I support Manchester United meclizine otc cvs “It was a confirmation that if you post calorie information, more people are going to see it and more people are going to use it,” said Roxana Chen, lead author and social research scientist for public health for Seattle and King County.

  24. Arden Says:

    I like watching football anafranil sr 75 mg kullananlar Winterkorn will outline efficiency measures and investment plans at a staff gathering at the Wolfsburg plant on Thursday

  25. Edison Says:

    I’m from England how to get astelin nasal spray costs The more time you spend with him you see that he has that gift, he has that moxie

  26. Quintin Says:

    I’m a trainee growing amaryllis outdoors in florida Oracle Team USA successfully defended the trophy with a dramatic come-from-behind win over Emirates Team New Zealand.

  27. Isabel Says:

    A few months how to get prednisone online Should he confirm the diagnosis of at least three other experts that Andrew suffers from PTSD, Andrew could be released for humanitarian reasons, as Mexico does not have the ability to properly treat such a condition

  28. Cristopher Says:

    It’s serious bisoprolol preis apotheke Industry datashows that Tesco is the worst performer of Britain’s so-calledBig Four grocers, which also includes Wal-Mart’s Asda,Sainsbury’s and Morrisons, with its marketshare dropping to 28.8 percent at Sept

  29. Caleb Says:

    Just over two years bactrim and pregnancy side effects He said the company had ‘a false set of understanding’ of Fed requirements going into that test and has since been working constantly to improve its management.

  30. Claude Says:

    A law firm tricore payroll login The HSE provides free orthodontic treatment to children with the most severe orthodontic problems

  31. Angelina Says:

    I’m about to run out of credit para que sirve el enalapril maleato 20 mg The League was set up primarily to preserve peace, which it did with limited success

  32. Eric Says:

    I’d like to open an account robaxin online canada The movie’s famous extended centerpiece ballet now swirls in abstract expressionism.

  33. Blaine Says:

    A company car levaquin generic available And by 1939, a head coach named Art Argauer, himself born in Germany, had built the high school football team into a powerhouse with 20 consecutive victories.

  34. Renaldo Says:

    Could I have an application form? where i can buy prednisone 20mg The images are printed in circulars sent to 80 million Americans each week and posted at Wal-Mart stores.

  35. Trenton Says:

    What sort of work do you do? levlen 28 reviews Teams from both sides had met late into the night with United Nations representatives to try to finalise a power-sharing deal before Sunday’s scheduled announcement of the final election results after a U.N.-monitored audit and recount.

  36. Roderick Says:

    I can’t get a signal does anafranil cure ocd A finish on December 18 – which is Qatar National Day and also a Sunday – would mean a November 21 start for a World Cup Fifa has already confirmed would last only 28 days, half a week shorter than usual.

  37. Mackenzie Says:

    Three years 2064 prednisone for sale It’s just when he moves the ball and keeps guys off-balance, that’s when he’s most effective.”

  38. Elden Says:

    Could I ask who’s calling? anafranil withdrawal He says they were lucky the parts were available and interchangeable, and took only half an hour to remove.

  39. Goodboy Says:

    Until August where to buy periactin appetite stimulant The poultry sector fears the virus could spread through the much bigger domestic chicken industry

  40. Delbert Says:

    What do you do for a living? topamax discount card People shouldn't be surprised at the metal key's longevity, says David Edgerton, professor of the history of science and technology at King's College London

  41. Connor Says:

    Have you got any ? order altace Priebus told reporters earlier in the week that the “slicing and dicing … in the debates is a mess for our party,” as well as the prolonged primary calendar that pits candidates against one another for “way too long.”

  42. Ahmad Says:

    I’ve got a part-time job duricef antibiotic dosage Still, he said every option should be pursued to stop the world’s biggest-ever outbreak of Ebola.

  43. Nathaniel Says:

    Wonderfull great site buy apcalis online It’s absolutely barbaric. The child has no say and no way to say whether it would prefer to live or die, so it’s the choice of one over the choice of another who can’t even express it. If you’re so interested in choice, they should chose not to get pregnant and appreciate that certain actions have consequences. And I’m not talking about the exception when it’s the case that the pregnancy is as a result of rape. In that case it’s very tragic, but even then why should further tragedy come about by killing the child? Are we really that callous and cold these days that the most helpless and vulnerable can be killed in such a cruel manner. It’s horrific.

  44. Tyrone Says:

    Who would I report to? cheap plendil Elsewhere the Jets have also inquired about Cowboys right tackle Jermey Parnell, according to a source

  45. Donnie Says:

    What do you like doing in your spare time? buy azelastine Resembling a standard circular-shaped red meat patty, it was created by knitting together 20,000 strands of laboratory-grown protein, combined with other ingredients normally used in burgers, such as salt, breadcrumbs and egg powder. Red beet juice and saffron were added to give it color.