Select to view content in your preferred language

setting full extent in "straight" API application

902
2
03-17-2011 01:12 PM
JustinRiggs
Emerging Contributor
in the sample viewer there's a fullextent property that you can set to constrain the map's full extent. Can you do this same thing in a "straight" API application? If so, would someone mind sharing the syntax?
Tags (2)
0 Kudos
2 Replies
andrewj_ca
Frequent Contributor
When you load your page set a fullExtent variable:

private var fullExtent:Extent = new Extent(x,y,xx,yy,map.spatialReference);

Then create a function to use that when you want thje full extent shown.

Mine looks like this:

private function mapfullExtent():void
{
try{
  if (fullExtent !=null)
  {
   map.extent = fullExtent;
  }else{
   navToolbar.zoomToFullExtent();
  }
 
}catch(err:Error){
}
}
0 Kudos
KenBuja
MVP Esteemed Contributor
Take a look at Mansour Raad's blog on constraining the extent
0 Kudos