How can i specify start position within custom panorama street view

152 views
Skip to first unread message

ma...@creatiworks.ca

unread,
Mar 8, 2011, 11:07:12 PM3/8/11
to google-map...@googlegroups.com
I have created a custom panorama set using the code in this example
http://code.google.com/apis/maps/documentation/javascript/services.html#TilingPanoramas

everything works perfectly.  The only thing I want to do now is to have one of my custom nodes be the starting (default) node rather than the entry point which is an actual (nearest) node on google street view.

I have tried
  panorama.setPano('storefront');
and
  map.setStreetView(panorama);
I've scoured google for a way to do this and cant find anything

can someone help me please?

ma...@creatiworks.ca

unread,
Mar 9, 2011, 8:01:46 PM3/9/11
to google-map...@googlegroups.com
up

Martin™

unread,
Mar 9, 2011, 11:53:32 PM3/9/11
to Google Maps JavaScript API v3
Can you post a link to your implementation of the example so we can
see better what is being asked?

Martin.


On Mar 10, 1:01 am, "m...@creatiworks.ca" <m...@creatiworks.ca> wrote:
> up

ma...@creatiworks.ca

unread,
Mar 13, 2011, 8:09:58 PM3/13/11
to google-map...@googlegroups.com
http://www.hindyshomehardware.ca/index.php?id=22

here's the link
I want the panorama of the front of the store to be the one that loads when the page loads.
not the actual street view one of the intersection.

ma...@creatiworks.ca

unread,
Mar 17, 2011, 12:57:18 PM3/17/11
to google-map...@googlegroups.com
up

Rossko

unread,
Mar 17, 2011, 3:46:54 PM3/17/11
to Google Maps JavaScript API v3
> I want the panorama of the front of the store to be the one that loads when
> the page loads.
> not the actual street view one of the intersection.

I think you just need to set the POV
http://code.google.com/apis/maps/documentation/javascript/services.html#StreetViewPanoramas

ma...@creatiworks.ca

unread,
Mar 21, 2011, 11:05:29 PM3/21/11
to google-map...@googlegroups.com, Rossko
I tried it but it didn't seem to help
here's my code maybe I'm doing something wrong
this is the initialize and start application functions which is where i assume you would put the setPosition function call
the POV is set already in panoOptions and really only sets the camera orientation anyway so really the only thing that will help here is setPosition.
I've tried setPosition(storefront) in several different locations in that code and it does nothing.  it actually breaks the link between the streetview and my custom panoramas
storefront is the name of the panorama object that i want to start at.
you can see the full javascript code tho if you view my source on the site and look at the js.

[code]

var carbonear_intersection = new google.maps.LatLng(47.724158, -53.24083);
var storefront = new google.maps.LatLng(yaddayadda);
var etc etc....
there's alot of them

function initialize() {

  startApplication();

  // Define how far to search for an initial pano from a location, in meters.   
  var panoSearchRadius = 30;

  // Create a StreetViewService object.
  var client = new google.maps.StreetViewService();
 
  // Compute the nearest panorama to the Google Sydney office
  // using the service and store that pano ID. Once that value
  // is determined, load the application.
  client.getPanoramaByLocation(carbonear_intersection, panoSearchRadius, function(result, status) {
    if (status == google.maps.StreetViewStatus.OK) {
      entryPanoId = result.location.pano;
    } 
  });
}

function startApplication() {
 
  // Set up the map and enable the Street View control.
  var mapOptions = {
    center: carbonear_intersection,
    zoom: 7,
    mapTypeId: google.maps.MapTypeId.ROADMAP
  };
  map = new google.maps.Map(document.getElementById('map_canvas'), mapOptions);
   // Get the default StreetViewPanorama object.
  panorama = map.getStreetView();
   // Set up Street View and initially set it visible. Register the
  // custom panorama provider function. Update the StreetViewPanorama.
  var panoOptions = {
    position: carbonear_intersection,
    visible: true,
    panoProvider:  getCustomPanorama,
    pov: {heading:30, pitch:0, zoom:2},
    addressControl: false,
    enableCloseButton: false
  }
  panorama.setOptions(panoOptions);

  // We'll monitor the links_changed event to check if the current pano is either
  // a custom pano or our entry pano.       
  google.maps.event.addListener(panorama, 'links_changed', createCustomLinks);
}

[/code]

Rossko

unread,
Mar 22, 2011, 3:15:58 PM3/22/11
to Google Maps JavaScript API v3
> http://www.hindyshomehardware.ca/index.php?id=22

I get a javascript error "map.setPosition is not a function"
map.setPosition('storefront');
API map object doesn't have a setPosition method, your 'panorama'
object should.

ma...@creatiworks.ca

unread,
Mar 24, 2011, 8:31:31 AM3/24/11
to google-map...@googlegroups.com, Rossko
I changed the line to:
panorama.setPosition('storefront');
no change

Reply all
Reply to author
Forward
0 new messages