I am having problems accessing the .swc file to import. I have to
import com.esri.viewer.AppEvent;
import com.esri.viewer.components.toc.TOC;
import com.esri.viewer.components.toc.tocClasses.TocKmlFolderItem;
import com.esri.viewer.components.toc.tocClasses.TocKmlNetworkLinkItem;
import com.esri.viewer.components.toc.tocClasses.TocMapLayerItem;
My end result will be to load KML into Flexxviewer. Where can I find the correct library?
... look foward to better KML support when it comes out.
sdat,I've noticed that the KML file must be Public in order for parsing. I work in an area that might require some sensitive kml data, any plans at ESRI to provide some local parsing?Thanks.
Did it render any points for you in your test. I can open it in GE, so I know the server is working for GE, but not in Flex.
Do I use the code you provide in the main application file?
One more point I noticed, no pop-ups in the included kml samples, of the online sample map. So if I click on the western railroads kml on the sample map, it does nothing. So if those popups need seperate xml files in the popups menu, and example of how to create those for a kml would be nice, once the kml is working.
var kmlLayer:KMLLayer = new KMLLayer(); kmlLayer.url = // url to kml document map.addLayer(kmlLayer);
private static function createKmlFolderTocItem(parentItem:TocItem, folder:KMLFolder, folders:Array, layer:KMLLayer):TocKmlFolderItem { var item:TocKmlFolderItem = new TocKmlFolderItem(parentItem, folder, layer); // Handle any sublayers of a group layer if (folder.subFolderIds && folder.subFolderIds.length > 0) { var lookInFeatureInfos:Boolean = true; for each (var childId:Number in folder.subFolderIds) { var childFolder:KMLFolder = findFolderById(childId, folders); if (childFolder) { item.addChild(createKmlFolderTocItem(item, childFolder, folders, layer)); } } } else if (folder.featureInfos && folder.featureInfos.length > 0) { for each (var featureInfo:KMLFeatureInfo in folder.featureInfos) { if (featureInfo.type == KMLFeatureInfo.NETWORK_LINK) { var networkLink:KMLLayer = layer.getFeature(featureInfo) as KMLLayer; item.addChild(createKmlNetworkLinkTocItem(item, networkLink, layer)); } } } return item; } private static function createKmlNetworkLinkTocItem(item:TocItem, networkLink:KMLLayer, layer:KMLLayer):TocKmlNetworkLinkItem { var tocKmlNetworkLinkItem:TocKmlNetworkLinkItem = new TocKmlNetworkLinkItem(item, networkLink, layer); if (networkLink.loaded) { createKMLLayerTocItems(tocKmlNetworkLinkItem, networkLink); // as network link is also a type of KMLLayer } else { networkLink.addEventListener(LayerEvent.LOAD, layerLoadHandler); } function layerLoadHandler(event:LayerEvent):void { createKMLLayerTocItems(tocKmlNetworkLinkItem, networkLink); } return tocKmlNetworkLinkItem; }
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.