args = $args; $this->site = new MgSiteConnection(); $this->site->Open(new MgUserInformation($args['SESSION'])); } function GetMapLayerNames() { $layerNames = array(); $resourceService = $this->site->CreateService(MgServiceType::ResourceService); $map = new MgMap($this->site); $map->Open($this->args['MAPNAME']); $layers = $map->GetLayers(); for ($i = 0; $i < $layers->GetCount(); $i++) { $layer = $layers->GetItem($i); //TODO: Exclude Raster and Drawing Layers??? if((substr($layer->GetName(), 0, 1) != "_") && (substr(strtoupper($layer->GetFeatureSourceId()), 0, 7) != "SESSION") && ($layer->IsVisible()) && $layer->GetSelectable()) { $layerNames[$layer->GetName()] = $layer->GetLegendLabel(); } } asort($layerNames); return $layerNames; } function SelectFeatures() { } } ?>