I've been trying to create a node.js script that will allow me to upload 360 degree photo spheres to Google Maps. I'm thinking I'll need to attach some custom metadata to the image. I've already figured out the first 2 requests.
3rd request: POST https://streetviewpublish.googleapis.com/v1/photo?key=X with body:
{
"uploadReference":
{
"uploadUrl": "https://streetviewpublish.googleapis.com/media/user/113033544511164xxxxxx/photo/6699853318082xxxxxx"
},
"pose":
{
"latLngPair":
{
"latitude": X,
"longitude": -Y
},
"heading": 0
}
}
I've censored some personal information
With the 3rd request, I am getting an error saying that it's not a 360 photo.
I'm assuming I will need to attach metadata to the image, however I can only find answers on VIEWING metadata, not writing it.
https://developers.google.com/streetview/spherical-metadata Here is the metadata that is required. I would like to be able to add this metadata using Node.js, really just looking for the simplest way to add metadata, I'd prefer to be able to just copy and paste the metadata without having to change the format of it, and just editing the values to my values. Hopefully adding metadata will fix my issue, however if it's something else please let me know!
I've already figured out the first 2 requests.
POST https://streetviewpublish.googleapis.com/v1/photo:startUpload?key=X - I get uploadUrl from here
POST uploadUrl with image file as binary body. - No response, assuming it uploaded the file, because if I don't run this request I get a different error message, so the file is definitely uploaded. The image is a 2:1 resolution, so it shouldn't be an issue with the aspect ratio. (13704x6852) The 360 image came from my DJI spark drone and stitched together using the DJI Media Maker, DJI doesn't make a full image so I increase the height of the image and add some color into the blind spot of the drone in order to make it 2:1 aspect ratio. These images worked in the Google Streetview android app, however, they are discontinuing the app, which is why I'm creating my own script (also because I'd like to be able to upload on computer and Google's new StreetView Studio only supports videos).