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);
}
}
------------
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);
}
}