So, this really won't work for what I am doing. What I am doing is opening a popup to display Google Street View data. As the user clicks down a road, I want to have a graphic move on the map. So, what I am thinking is that the popup will pass the lat/lon to the flex app. I am pretty close, but I don't really like what I have to do to make it work. I get the lat lon back in my index.template.html and it shows the alert. But, I don't know how to get that in my flex application.Google Street Map Popup Window[HTML]<!DOCTYPE html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <title>Street View</title> <link href="http://code.google.com/apis/maps/documentation/javascript/examples/standard.css" rel="stylesheet" type="text/css" /> <script src="http://maps.google.com/maps/api/js?sensor=false" type="text/javascript"></script> <script type="text/javascript"> var position = ""; function initialize() { lat = getParams('lat'); lng = getParams('lng'); var loc = new google.maps.LatLng(lat,lng); var panoramaOptions = { position: loc, pov: { heading: 34, pitch: 0, zoom: 1 }, visible: true }; var panorama = new google.maps.StreetViewPanorama(document.getElementById("pano"),panoramaOptions); google.maps.event.addListener(panorama, 'position_changed', function() { var positionCell = document.getElementById('position_cell'); positionCell.firstChild.nodeValue = panorama.getPosition(); position = positionCell.firstChild.nodeValue; sendLatLon(position); }); } function getParams( name ){ name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]"); var regexS = "[\\?&]"+name+"=([^&#]*)"; var regex = new RegExp( regexS ); var results = regex.exec( window.location.href ); if( results == null ) return ""; else return results[1]; }function sendLatLon(position){ //Send the lat lon back to the parent window window.opener.callBack(position); }</script> </head> <body onload="initialize()"> <div id="pano" style="width: 100%; height: 640px;z:index: 0"></div> <div id="footer" style="height:30px;"> If no image appears StreetView is not available </div> <div id="panoInfo" style="width: 425px; height: 240 px;float:left"> <table> <tr> <td><b>Position</b></td><td id="position_cell"> </td> </tr> </table> </div> </body> </html> [/HTML]Function from my index.template.html
var flexParams = "latlon=";
function callBack(latlon){
flexParams = "latlon=" + latlon;
alert(flexParams);
}
Function that I use to display the street view popup.
private function mouseDownHandler(e:MapMouseEvent):void
{
Model.instance.streetViewVis = true;
var mapPoint:MapPoint = WebMercatorUtil.webMercatorToGeographic(e.mapPoint) as MapPoint;
var lng:String = mapPoint.x.toFixed(13);
var lat:String = mapPoint.y.toFixed(13);
// launch street view
var url:String = "StreetView.html?lat=" + lat + "&lng=" + lng;
var window:String = "StreetView";
var features:String = "toolbar=no,location=no,resizable=no,directories=no,status=no,scrollbars=no,copyhistory=no,width=610,height=700";
var WINDOW_OPEN_FUNCTION : String = "window.open";
ExternalInterface.call( WINDOW_OPEN_FUNCTION, url, window, features );
}