Exemple #1
0
 public function checkAddressGoogle($data)
 {
     $Adresse = new Adresse($data["AdresseID"]);
     $B = new Button("Auf Karte anzeigen", "map_pin_stroke", "iconic");
     $B->style("float:right;font-size:30px;margin-top:-5px;");
     $B->onclick("showMap();");
     return "<p>" . $Adresse->getHTMLFormattedAddress() . "</p>\n\t\t<div class=\"backgroundColor1 Tab\">\n\t\t\t<p>Google-Antwort</p>\n\t\t</div>\n\t\t<p id=\"gAnswer\"></p>\n\t\t<div id=\"map_canvas\" style=\"width:100%; height:400px;display:none;\"></div>" . OnEvent::script("\n\t\t\t\n\t\tvar map;\n\t\tvar geocoder = new google.maps.Geocoder();\n\t\tvar r;\n\t\tfunction showMap(){\n\t\t\t\$('#map_canvas').show();\n\t\t\tmap = new google.maps.Map(document.getElementById('map_canvas'), {\n\t\t\t  zoom: 16,\n\t\t\t  center: latlng = new google.maps.LatLng(-34.397, 150.644),\n\t\t\t  mapTypeId: google.maps.MapTypeId.ROADMAP\n\t\t\t});\n\n\t\t\tmap.setCenter(r[0].geometry.location);\n\t\t\tvar marker = new google.maps.Marker({\n\t\t\t\tmap: map,\n\t\t\t\tposition: r[0].geometry.location\n\t\t\t});\n\t\t}\n\t\tsetTimeout(function(){\n\t\t\tgeocoder.geocode( { 'address': '" . str_replace("\n", ", ", $Adresse->getFormattedAddress()) . "'}, function(results, status) {\n\t\t\t\tif (status == google.maps.GeocoderStatus.OK) {\n\t\t\t\t\tvar foundLoc = results[0].geometry.location_type;\n\t\t\t\t\tif(foundLoc == 'APPROXIMATE' || foundLoc == 'RANGE_INTERPOLATED')\n\t\t\t\t\t\tfoundLoc = 'Ungefähr gefunden';\n\n\t\t\t\t\tif(foundLoc == 'ROOFTOP' || foundLoc == 'GEOMETRIC_CENTER')\n\t\t\t\t\t\tfoundLoc = 'Genau gefunden';\n\t\t\t\t\t\t\n\t\t\t\t\tr = results;\n\t\t\t\t\t\$('#gAnswer').html('{$B}'+foundLoc);\n\t\t\t\t\t\n\t\t\t\t\tCustomerPage.rme('reportCheckAddressGoogleOK', {AdresseID: {$data['AdresseID']}});\n\t\t\t\t\t\$('#BCheckG').css('color', 'green');\n\t\t\t\t} else {\n\t\t\t\t\t\$('#gAnswer').html(\"<span style='color:red;'>Die Adresse wurde nicht gefunden!</span>\");\n\t\t\t\t\tCustomerPage.rme('reportCheckAddressGoogleError', {AdresseID: {$data['AdresseID']}});\n\t\t\t\t\t\n\t\t\t\t\t\$('#BCheckG').css('color', 'darkred');\n\t\t\t\t}\n\n\t\t\t});\n\t\t}, 300);");
 }
 public static function parserKunde($w, $p)
 {
     $Adresse = new Adresse($p);
     return utf8_decode($Adresse->getFormattedAddress());
 }