trang mạng:Udaljenosti među gradovima i planer putovanja | Udaljenosti.comNội dung
Udaljenostimeđugradovimaiplanerputovanja|Udaljenosti.com(function(d,s,id){varjs,fjs=d.getElementsByTName(s)[0];if(d.getElementById(id))return;js=d.createElement(s);js.id=id;js.src="//connect.facebook.net/en_GB/all.js#xfbml=1";fjs.parentNode.insertBefore(js,fjs);}(document,'script','facebook-jssdk'));window.___gcUdaljenosti među gradovima i planer putovanja | Udaljenosti.comfg={lang:'hr'};(function(){varpo=document.createElement('script');po.type='text/jascript';po.async=true;po.src='apis.google.com/js/plusone.js';vars=document.getElementsByTName('script')[0];s.parentNode.insertBefore(po,s);})();UdaljenostimeđugradovimaiplanerputovanjaDistanceCalculator(adsbygoogle=window.adsbygoogle||[]).push({});UdaljenostimeđugradovimaiplanerputovanjaIzračunajteudaljenostimeđugradovimaimjestimanakartijednostnimupisivanjemnazivamjestaupoljanatražilici.Zaplanerputovanjaodaberiteikonu"Planerputovanja"sdesnestrane.Zavremenskuprognozuodaberiteikonu"Prognoza". Od DoZračnaudaljenost(km)Cestovnaudaljenost(km) (adsbygoogle=window.adsbygoogle||[]).push({});(adsbygoogle=window.adsbygoogle||[]).push({});ProjektUdaljenosti.comjezamišljenkaopomoćnialatpribrzom,jednostnomitočnomračunanjuzračneicestovneudaljenostiizmeđugradovaimjesta.AlatomUdaljenosti.compokrivaseračunanjeudaljenostimjestaigradovazaslijedećedrže:HrvatskaBosnaiHercegovinaSlovenijaSrbijaAlbanijaKosovoItalijaAustrijaMađarskaRumunjskaBugarskaNjemaUdaljenosti među gradovima i planer putovanja | Udaljenosti.comčkaNizozemskaKakoizbjećiautocesteuHrvatskojVozniredvlakova©2012Udaljenosti.com|Oprojektu|Uvjetikorištenja|Kontakt|Udaljenostiikilometražameđugradovima.Planerputovanjaiostalo.functioninitialize(){varpe='site',from=$('#distancefrom').val(),to=$('#distanceto').val();show=[];//lat,lon,zoomif(from.length>0&&to.length>0){initializeG();}else{show=[45.5,15.58,5];showOsmMap();functionshowOsmMap(){varmapOsm=L.map('map');if(show.length)mapOsm.setView([show[0],show[1]],show[2]);L.tileLayer('{s}.tile.osm.org/{z}/{x}/{y}.png',{id:'mapbox.streets'}).addTo(mapOsm);}}}vargeocoder,map,addresses,results,dist,loaded=false,first=true;functionopenInNewTab(url){varwin=window.open(url,'_blank');win.focus();}functionseTo(){address1=document.getElementById("distancefrom").value;address2=document.getElementById("distanceto").value;$.ajax({type:"GET",url:"/site/seto",data:{a1:address1,a2:address2},contentType:"application/json;charset=utf-8",dataType:"json",success:function(response){},failure:function(msg){}});}functioninitializeG(){address1=document.getElementById("distancefrom").value;address2=document.getElementById("distanceto").value;openInNewTab('/maps/dir/'+address1+'/'+address2+'/');return;geocoder=newgoogle.maps.Geocoder();(distance(address1,address2));}functiondistance(add1,add2){if(!geocoder)return'Error,nogeocoder';addresses=newArray(2);addresses[0]=add1;addresses[1]=add2;results=newArray(2);results[0]=newArray(2);results[1]=newArray(2);results[0][0]=0;results[0][1]=0;results[1][0]=0;results[1][1]=0.87;if(first===true&&true===false){first=false;geocodedcity(1);}elsegeocoded(1);}functiongeocoded(i){if(addresses[i]===""){varmapOptions={zoom:6,center:newgoogle.maps.LatLng(45.50,15.58),mapTypeId:google.maps.MapTypeId.ROADMAP};map=newgoogle.maps.Map(document.getElementById("map"),mapOptions);}elsegeocoder.geocode({'address':addresses[i]},function(res,status){if(status==google.maps.GeocoderStatus.OK){results[i][0]=parseFloat(res[0].geometry.location.lat());results[i][1]=parseFloat(res[0].geometry.location.lng());i--;if(i>=0)geocoded(i);else{varlatlng1=newgoogle.maps.LatLng(results[0][0],results[0][1]);varlatlng2=newgoogle.maps.LatLng(results[1][0],results[1][1]);dist=google.maps.geometry.spherical.computeDistanceBetween(latlng1,latlng2)/1000;document.getElementById('totaldistancekm').value=dist.toFixed(2);if(document.getElementById('udaljenostiair'))document.getElementById('udaljenostiair').innerHTML=dist.toFixed(2);showMap(latlng1,latlng2);}}elseif(status==google.maps.GeocoderStatus.ZERO_RESULTS){varmapOptions={zoom:6,center:newgoogle.maps.LatLng(45.50,15.58),mapTypeId:google.maps.MapTypeId.ROADMAP};map=newgoogle.maps.Map(document.getElementById("map"),mapOptions);}});}functiongeocodedcity(i){i=0;geocoder.geocode({'address':''},function(res,status){if(status==google.maps.GeocoderStatus.OK){results[i][0]=parseFloat(res[0].geometry.location.lat());results[i][1]=parseFloat(res[0].geometry.location.lng());i--;if(i>=0)geocoded(i);else{varmapOptions={zoom:13,center:newgoogle.maps.LatLng(results[0][0],results[0][1]),mapTypeId:google.maps.MapTypeId.ROADMAP};map=newgoogle.maps.Map(document.getElementById("map"),mapOptions);}}});}functionshowMap(location1,location2){latlng=newgoogle.maps.LatLng((location1.lat()+location2.lat())/2,(location1.lng()+location2.lng())/2);varmapOptions={zoom:7,center:latlng,mapTypeId:google.maps.MapTypeId.ROADMAP};map=newgoogle.maps.Map(document.getElementById("map"),mapOptions);varflightPlanCoordinates=[location1,location2];varflightPath=newgoogle.maps.Polyline({path:flightPlanCoordinates,strokeColor:"#FF0000",strokeOpacity:.5,geodesic:true,strokeWeight:4});flightPath.setMap(map);varflightPath=newgoogle.maps.Polyline({path:flightPlanCoordinates,strokeColor:"#",strokeOpacity:.5,strokeWeight:4});flightPath.setMap(map);calcRoute();}vardirectionsDisplay=newgoogle.maps.DirectionsRenderer();vardirectionsService=newgoogle.maps.DirectionsService();functioncalcRoute(){directionsDisplay.setMap(map);varstart=document.getElementById("distancefrom").value;varend=document.getElementById("distanceto").value;varrequest={origin:start,destination:end,trelMode:google.maps.TrelMode.DRIVING};directionsService.route(request,function(result,status){if(status==google.maps.DirectionsStatus.OK){directionsDisplay.setDirections(result);km=result.routes[0].Udaljenosti među gradovima i planer putovanja | Udaljenosti.comlegs[0].distance.value/1000;document.getElementById('totaldistancekmroute').value=(km).toFixed(2);if(document.getElementById('udaljenostiroute'))document.getElementById('udaljenostiroute').innerHTML=(km).toFixed(2);if(typeofinDb=='function')inDb();}});}var_gaq=_gaq||[];_gaq.push(['_setAccount','UA--1']);_gaq.push(['_trackPeview']);(function(){varga=document.createElement('script');ga.type='text/jascript';ga.async=true;ga.src=(':'==document.location.protocol?'ssl':'httpwww')+'.google-analytics.com/ga.js';vars=document.getElementsByTName('script')[0];s.parentNode.insertBefore(ga,s);})();