Locations of visitors to this page

 

Selecting data on the map.

To perform selection on a map you need to write some action script and to understand the inside of the map you use.
There is a tool available (When you installed the map extention) under the menu Window->Other panels->Arc IMS services.

Type the following script.

// Create a dataLayer object ! This is case sensitive!!
//
var my_lyr = new maps_v2.dataLayer;
// Define the layer you want to select from. You can find the name inside the help tool above.
my_lyr.fromlayer = 'SDEEPER_points';
my_lyr.layerid = 'SDEEPER_points_select';
// The way the selection needs to be shown on the map. In this case by a cricle arround the selected
// points 10pixcels big using color blue.
my_lyr.markersymbol_type = 'circle'
my_lyr.markersymbol_width = 10
my_lyr.markersymbol_color = 0x0000FF;
// Add this selection createria to my_map
my_map.addSelection(my_lyr);

At this moment you should be able to see you selection on the map. The next part is to capture the result when it came back from the server. You do that by the event onSelectionResult(mySelection,myObject). There are many ways to read the content out but the easiest is to just list it inside a grid.

Drag a grid on the stage and name it 'my_grid'

type under the previous code the following. This code will capture the selection and pass it on to the grid object.

my_map.onSelectResult = function(myResult:Array,myObj:Object) {
_root.my_grid.dataProvider = myResult;
}

You can try the result here.

 

Source code : sample4.fla