Quantcast
Channel: Forums - ArcGIS Viewer for Flex
Viewing all articles
Browse latest Browse all 2097

Load Bing Map & Google Maps

$
0
0
I borrowed a piece of code to load Bing and Google maps. The related piece of code is below. However, neither google map or Bing map displays on the browser. I am not sure whether I should have token/key for Bing/google map. If yes, where should code to include the token/key? Thanks.


------------
public var mapClickHandler:Function;

public function bing_clickHandler():void {
mapClickHandler = generateLinkHandler(WebMapLinkEvent.BING);
map.addEventListener(MapMouseEvent.MAP_CLICK, mapClickHandler);
}

public function google_clickHandler():void {
mapClickHandler = generateLinkHandler(WebMapLinkEvent.GOOGLE);
map.addEventListener(MapMouseEvent.MAP_CLICK, mapClickHandler);
}

private function generateLinkHandler(linkType:String):Function {
return function (event:MapMouseEvent):void {
var point:MapPoint = event.mapPoint;
var link:WebMapLinkEvent = new WebMapLinkEvent()
link.point = point;
link.mapType = linkType;
CentralDispatcher.dispatchEvent(link);
}
}

Viewing all articles
Browse latest Browse all 2097

Trending Articles