Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I use flex and OpenScale and I want to limit visibility just over Morocco using the coordinates, please how can I do that?!

    <os:Map id="fxmap" width="100%" height="100%" zoom="3" center="4.83212,45.75781">
    <os:Mapnik name="base"/>
    <os:PanZoom map="{map}" x="{fxmap.x+10}" y="{fxmap.y+10}"/>

I can do that on the properties of the map ?

share|improve this question
I've never heard about Open Scales. This should be an interesting discussion. – jvangeld Dec 17 '11 at 19:29
up vote 0 down vote accepted

I'v found a solution not good but it's working and it's mine ^^

import org.openscales.geometry.basetypes.Pixel;
public function reCadreMap(e:MapEvent)

//var x,y,x1,y1;
var maxLon =-1879357.2032504533;//left
var minLon=-015419.9442366438;//right

var maxLat=2440863.5691261655;//down
var minLat=4291633.447018889;//up
var border:Object=map.getLocationFromMapPx(new Pixel(map.width/2,map.height/2));

    var lat= border["lat"]/100000;
    var lon=-15;

    map.moveTo(new Location(lon,lat),5,true,true);
else if(border["lon"]>minLon){//right
    var lat = (border["lat"]/100000)-5;
    var lon=-4;

    map.moveTo(new Location(lon,lat),4,true,true);
else if(border["lat"]>minLat){//up
    var lat = 33;
    var lon=(border["lon"]/100000);

    map.moveTo(new Location(lon,lat),5,true,true);
else if(border["lat"]<maxLat){//down
    var lat = 26;
    var lon=(border["lon"]/100000);

    map.moveTo(new Location(lon,lat),5,true,true);


this exemple is for who want to limit visibility, and i'm attending any reaction from you !

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.