style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
"spanqy" <My
href="mailto:msanchez@specservices.com">msanchez@specservices.com>
wrote in message
href="news:f150e5c.-1@WebX.maYIadrTaRb">news:f150e5c.-1@WebX.maYIadrTaRb...
function below only selects 2 features on my map instead of the 30+ it should.
If I change the layer name (from "Tanks" to "Pumps" for example) only 1 map
feature is selected -- in a totally different area of the map!
I have set the "getMapExtent" method to return the entire map area in
lat/lon coords (false, false).
My map is in Arbitrary *XY-Ft* coords, yet
even when i try a (false, true) argument to return the MCS points, the same
getMin/getMax values are returned.
The selectPolygonEx method below is returning true, indicating that the
values passed to it are valid
argument types.
After some initial problems, I feel I'm now on the right track with this
routine, and very close to completing it. Can anybody out there please
pinpoint my problem?
Thank you,
Mark Sanchez
// function to select all map features
function selectall()
{
var map = getMap();
var layer = map.getMapLayer("Tanks");
map.setAutoRefresh(false);
// returns MGExtentEx bounding box for
entire map in lat/lon values
var mapext = map.getMapExtent(false, false);
// (false, true) yields same getMin/getMax values
var llpt = map.createObject("MGPoint");
llpt.setX(mapext.getMinX()); //
lon
llpt.setY(mapext.getMinY()); // lat
var urpt = map.createObject("MGPoint");
urpt.setX(mapext.getMaxX()); //
lon
urpt.setY(mapext.getMaxY()); // lat
var bbox = map.createObject("MGCollection");
bbox.add(llpt); // lower
left
bbox.add(urpt); // upper right
var bsel = map.selectPolygonEx(layer, bbox);
map.setAutoRefresh(true);
map.refresh();
if (bsel == true)
alert("Success");
else
alert("Failure");
}