Zoom Home Button

2421
1
Jump to solution
10-08-2015 01:57 AM
PatrickWild3
New Contributor III

How do I adjust the zoom extent of the 'Home' button?

I would like to zoom to the initial extent of my operational layers rather than a global view.

Thanks,

PW

0 Kudos
1 Solution

Accepted Solutions
HannahFerrier
Occasional Contributor III

Hello Patrick,

The home extent for the Zoom Buttons needs to be a defined envelope. For example, include your home extent envelope in your app qml like this:

    Envelope {
        id: mapHomeExtent
        xMin: -9908547
        yMin: -5120850
        xMax: 10128960
        yMax: 14916657
    }


Then, declare the home extent inside the Zoom Buttons like this:

   ZoomButtons {

           homeExtent: mapHomeExtent
            }

Hope this helps!

- Hannah

View solution in original post

1 Reply
HannahFerrier
Occasional Contributor III

Hello Patrick,

The home extent for the Zoom Buttons needs to be a defined envelope. For example, include your home extent envelope in your app qml like this:

    Envelope {
        id: mapHomeExtent
        xMin: -9908547
        yMin: -5120850
        xMax: 10128960
        yMax: 14916657
    }


Then, declare the home extent inside the Zoom Buttons like this:

   ZoomButtons {

           homeExtent: mapHomeExtent
            }

Hope this helps!

- Hannah