0

I am creating a platform similar to Google Street View where a user can click on a map and open a picture of a road section. Unlike Google Street the images are not continuous and a user should click on small dots showing on the map. When user click a dot on the map, an image should pop-up and then they should be able to navigate back and forth by clicking on the NEXT or BACK buttons to see other part of the road.

All images are going to be uploaded on Google Drive. All I need is a link of each picture to connect it to my GIS system. Following Google Drive API Guide, I was able to retrieve image IDs and share the hyperlinks. However, once share links are created, each image is stand alone and user cannot scroll through images meaning there is no NEXT or BACK button when they click on those hyperlinks. Is there anyway to share each image but the user scroll through other images contained in that folder? In other words, when sharing an image in Google Drive, I would like my client access to other images in the folder. Here is an example:

with this image, a user can scroll and navigate to the next image

*note: ">" and "<" signs on each end indicate the ability to navigate back and forth

But when it is shared, a user cannot scroll and navigate to the next image

Some additional Notes: It is possible to share the driver folder with them. The hyperlinks are displayed in ArcGIS online. I need a hyperlink for each image. Once the client click on a particular hyperlink, images should pop-up (but I want them to be able to move forward without clicking on hyperlinks again). I am a Python programmer so ideally I would like to code in Python.

def main(credentials=creds, q, size, *scopes):
    SCOPES = [scope for scope in scopes[0]]
    service = build('drive', 'v3', credentials=creds)
    results = service.files().list(q=query,
        pageSize=size, fields="nextPageToken, files(id, name)").execute()
    items = results.get('files', [])
    nextPageToken = results.get('nextPageToken')
    df = pd.DataFrame.from_dict(items)
    
    return df

if __name__ == '__main__':
    
    cred= 'credentials_Drive.json'
    SCOPES = ['https://www.googleapis.com/auth/drive.metadata.readonly']
    df = main(credentials=creds, q="", size=1000, *scopes)
    ## I then use the ID to share the files 
    

NightEye
  • 10,634
  • 2
  • 5
  • 24

1 Answers1

0

Since you were accessing an image independently by getting the link for each one, accessing that link will only access that particular image.

This boils down on how you make use of the files that you were able to fetch using the API.

You will need to create your own image viewer to view those images using the links you got. You can use TKinter if it is an option.

Reference:

NightEye
  • 10,634
  • 2
  • 5
  • 24
  • 1
    I was able to fix the problem with Google Photos. Google Photos can access all files within the folder. – Mostafa Nakhaei Aug 24 '21 at 18:36
  • I'm glad you were able to make use of google photos. I had the assumption you want it in terms of python due to your last statement but if Google Photos was able to fix your issue, then all the better. Goodluck @MostafaNakhaei – NightEye Aug 24 '21 at 18:38
  • 1
    Thanks, yes I wanted it in Python but instead of Google Drive the trick was to use Google Photos. In this way, the generated link files are not independent. (I used python to access google photos although they have REST) – Mostafa Nakhaei Aug 25 '21 at 20:39