-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add <StreetViewGoogleMap /> component #83
Comments
I think this is a great idea. I do think we can do a bit more than just generating a URL if we slightly modify the api to be <StreetViewGoogleMap
size="600x600"
apiKey="***"
location="6.4488387,3.5496361"
fallback={AnotherComponent}
/> By default, it would check if the Image Metadata for the url exists and then render the image if it does, or render the fallback if it does not. Still not sure the What do you think? |
Interesting. That's a nice find on the Metadata API. I have been experiencing the "Sorry, we have no imagery here..." and just lived with it. It's also nice to see that the Metadata API does not consume any of your Google quota. I am not sure we should get into fallbacks. I recently revisited #76 (comment). React offers us the metadataApi.find(...).catch(err => props.onError(error)) and let the user handle it instead of the lib managing fallbacks. I like that because the component DUCKS like a regular img tag so the user can bring their own progressive stuff. With that said, I am not against a more integrated fallback solution, just pointing out a basic one already exists. Should the Metadata API be opt in? Maybe the user does't want to deal with fallbacks or metadata and is fine with the synchronous URL and img tag. The Metadata API should also probably be cached in a similar manner to the caching mechanism for the |
Great. I'm all for leveraging the built-in events rather than adding additional props we have to maintain. I just want to point out that, technically, the image itself did not error. Without the metadata check, the api would still load a valid image and that's what would happen if a user opts out of the metadata check. I don't think it's an issue though especially since we know it's not the image the user wants that'll be loaded. Another concern, and the reason I added an |
Understood on the image "failure". I was actually getting 404's when initially developing my little component because I am hardcoding the URL and hardcoded them wrong 🤷. So I went ahead and added the I was stating that we could call |
Google supports a streetview image: https://developers.google.com/maps/documentation/streetview/overview
I am currently using this in two projects where I am hardcoding the URL, but I think this could be a nice addition to the library.
Unlike
StaticGoogleMap
, I don't think this component has any children. At first, I thought this would be another child component/strategy ofStaticGoogleMap
but its not. This component has a differentrootURL
and also cannot be composed with other elements like markers, etc. It is its own "base" component I believe.Any thoughts?
The text was updated successfully, but these errors were encountered: