Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. JavaScript
  4. google streetview

google streetview

Scheduled Pinned Locked Moved JavaScript
javascriptcomtoolstutorialquestion
2 Posts 2 Posters 2 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    douw3rd
    wrote on last edited by
    #1

    Heya, I'm trying to combine google streetview with input I get from other scripts. For example, I get a street name from a other script, but want an streetview window to automaticly load that street. I've been reading through the google documentation, and tried some examples found on the internet, but my decent lack of js skills are lacking me from getting much further. Google Maps StreetView[^] is an example, but this one works with an dragger, while I try to make it load automaticly on other input. Any one who can sling me into the right direction? :)

    R 1 Reply Last reply
    0
    • D douw3rd

      Heya, I'm trying to combine google streetview with input I get from other scripts. For example, I get a street name from a other script, but want an streetview window to automaticly load that street. I've been reading through the google documentation, and tried some examples found on the internet, but my decent lack of js skills are lacking me from getting much further. Google Maps StreetView[^] is an example, but this one works with an dragger, while I try to make it load automaticly on other input. Any one who can sling me into the right direction? :)

      R Offline
      R Offline
      richardw48
      wrote on last edited by
      #2

      These are the jscript functions you need ... This function takes an address as a string

      function showAddress(thisaddress)
      {
      var geocoder = new GClientGeocoder();
      geocoder.setBaseCountryCode("uk");
      geocoder.getLatLng(thisaddress, gotPoint);
      searchaddress=thisaddress
      }

      The next function is called by the one above in order to show the address or marker on a map Note that I've commented out the code that places a marker at the point

      function gotPoint(pt)
      {
      if (!pt)
      {alert(searchaddress + " not found");}
      else
      {
      // map.setCenter(point, 13);
      // var marker = new GMarker(point);
      // map.addOverlay(marker);
      // marker.openInfoWindowHtml(thisaddress);
      document.formInput.txtPoint.value = pt;
      panoClient.getNearestPanoramaLatLng(pt, fnearestpano);
      }
      }

      Finally, the function finds the nearest StreetView image to the address

      function fnearestpano(latlng)
      {
      if (!latlng)
      { alert("nearest view not found"); }
      else
      {
      //alert("point=" + latlng);
      myPano = new GStreetviewPanorama(document.getElementById("pano"));
      myPano.setLocationAndPOV(latlng, myPOV);
      }
      }

      Hope that helps? Richard

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups