GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — How to put restriction in zooming ? · Issue #305 · fullstackreact/google-maps-react

How to put restriction in zooming ? #305

New issue
Copy link
New issue
Copy link
Open
Open
How to put restriction in zooming ?#305
Copy link

Description

@gkumar9
gkumar9
opened on Jan 21, 2019
Issue body actions

I want to put zooming restriction.
like this : https://developers.google.com/maps/documentation/javascript/examples/control-bounds-restriction

Also, posted question in stackoverflow.
https://stackoverflow.com/questions/54216582/why-restriction-bound-property-not-working
Please help. Thanks

Reacted by Martin Lundin
Reacted by Gaurav Kumar
Reacted by Gaurav Kumar

Activity

  1. Ninjaman494 commented on Apr 28, 2020

    @Ninjaman494
    Ninjaman494
    on Apr 28, 2020
    More actions

    I know this an old issue, but I found that there are minZoom and maxZoom props, maybe you can use them to get the behavior you want? I'm using it like this to prevent the map from zooming in too much when the bounds are empty:

    <Map
        ref={this.mapRef}
        style={{color:'#283593'}}
        google={this.props.google}
        initialCenter={this.props.center}
        bounds={this.bounds}
        maxZoom={16}
    >
    
  2. martinlundin commented on May 16, 2020

    @martinlundin
    martinlundin
    on May 16, 2020
    More actions

    Yea the minZoom and maxZoom are very handy, but it would also be nice to have a restriction bound as described in Restricting Map Bounds
    Would be really awesome if it would work with something like this:

    <Map
    	google={this.props.google}
    	style={style}
    	zoom={15}
            initialCenter={{
                 lng: 17.08700585,
                 lat: 61.29914475
             }}
    	restriction={{
    	    latLngBounds: {
    	        north: 69,
    	        south: 53,
    	        west: 8,
    	        east: 25,
    	    },
    	    strictBounds: true,
    	}}
    >
    

    I tried it but unfortunately it doesn't seems to be implemented.

  3. stefan-francis commented on May 6, 2021

    @stefan-francis
    stefan-francis
    on May 6, 2021
    More actions

    Is there any way I can restrict the map to a boundary with latLngBounds?
    I tried to add the same example shown here but it seems it is still not implemented yet😞

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.