googlewebcomponents / google-streetview-pano Goto Github PK
View Code? Open in Web Editor NEWGoogle Maps Street View web component
Home Page: http://googlewebcomponents.github.io/google-streetview-pano
License: Other
Google Maps Street View web component
Home Page: http://googlewebcomponents.github.io/google-streetview-pano
License: Other
The documentation should be updated because the Views website is no longer supported.
Like in this example:
var panorama = new google.maps.StreetViewPanorama(
document.getElementById('pano'), {
position: fenway,
pov: {
heading: 34,
pitch: 10
}
});
map.setStreetView(panorama);
So, as Views went offline a year ago, streetview pano addresses don't look like this anymore:
google.com/maps/views/view/102684927602131521305/photo/1szTnskrdKIAAAGuu3fZRw
When using the panoid part from the new url structure (3D0Gu6eoWlrurprZQlhN1K3A), I am getting CORS blocked for Googles https://geo0.ggpht.com/ domain, as no Access-Control-Allow-Origin header is present on the requested resource, and a 400 for the resource. Can anyone think of a workaround or is the element just not usable anymore?
When using google-streetview-pano with iron-pages, going between pages causes this element to fail as data bindings for this.panoId and this.position have not been initialized at the time of the _mapApiLoaded callback.
In the use below, it works fine the first time I load the page, but after using iron-pages to flip between pages a second load will trigger the _mapApiLoaded callback before the _getMapPosition has had a chance to set the this.position value.
<google-streetview-pano
position="[[_getMapPosition()]]"
heading="330"
pitch="2"
zoom="0.8"
disable-default-ui>
</google-streetview-pano>
This can be fixed by wrapping _mapApiLoaded contents in this.async but its a bit hacky as I don't understand why this is happening. What do you guys think?
_mapApiLoaded: function() {
this.async(function() {
this.pano = new google.maps.StreetViewPanorama(this.$.pano, this._getPanoOptions());
this.pano.setVisible(true);
if (this.disableAutoPan) {
return;
}
// Kickoff the rotating animation
this.rAFid = requestAnimationFrame(this.update.bind(this));
});
},
I get errors like:
Uncaught TypeError: m[md].maps.Load is not a function
You have included the Google Maps API multiple times on this page. This may cause unexpected errors.
Any hints how best to fix?
StreetView panorama does not render in Shadow DOM.
Rendering is ok in Shady DOM.
The StreetView panorama.
Nothing, the "map" div seems to be deleted.
https://jsbin.com/quyaji/edit?html,output
The same result occurs when using google-map custom element and switching to StreetView, with the default control or programmatically.
A lot of its properties are re-implemented for this element.
If either of you has free time I'd love some code review. I think this element could be greatly improved by the universal loader/manager that we've been discussing. For now it requires a google-map element so it doesn't run into a situation where there are two elements both trying to load the google maps API at the same time.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.