Skip to content

How to get visible bounds? #108

@ribrewguy

Description

@ribrewguy

I have been struggling with how to determine the visible map bounds within the page. I require this ability in order to determine the area to search for markers within from a backend location service. I've tried several approaches to get to the underlying google API which appears to support my use case.

  mounted() {
    const map = this.$refs.myMap
    console.log('myMap: ', Object.keys(map))
    const gMap = map.getBounds()
    console.log('bounds: ', gMap)
  },

The first log prints multiple available keys, one being the getBounds() function. However, calling getBounds() returns undefined.

Please advise. Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions