i am trying to create multiple markers on google maps using action script for flex mobile project 4.5
this is the code from where im passing the cities and which will load the google maps
import spark.events.ViewNavigatorEvent;
private var myWebView:StageWebView;
private var city:String;
/**
* @protected
* Just add and set site of my StageWebView
* */
protected function view1_viewActivateHandler(event:ViewNavigatorEvent):void
{
// set the city with data default property of each view
city = data.toString();
myWebView = new StageWebView();
myWebView.stage = this.stage;
// myWebView.loadURL("http://maps.google.com"); // default
myWebView.loadURL("http://maps.google.com/maps?f=q&source=s_q&hl=en&geocode=&q="+ city + "&z=12&sensor=true");
myWebView.viewPort = new Rectangle(0,70,stage.stageWidth,stage.stageHeight);
}
/**
* @private
*
* Just override to re-scale due to auto-orientation project nature
* */
override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void {
if (myWebView) {
var point:Point = localToGlobal(new Point());
myWebView.viewPort = new Rectangle(0,0,stage.stageWidth,stage.stageHeight);
}
}
override protected function stateChanged(oldState:String, newState:String, recursive:Boolean):void
{
}
protected function goBackHandler(event:MouseEvent):void
{
navigator.popToFirstView();
}
protected function removeStageWebViewHandler(event:ViewNavigatorEvent):void
{
myWebView.stage = null;
// just remove the target and will leave.
}
]]>
</fx:Script>
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<s:navigationContent>
<s:Button label="Go Back" click="goBackHandler(event)"/>
</s:navigationContent>
i want to pass cities by storing all the cities in array and display all the cities(marker) protected function view1_viewActivateHandler(event:ViewNavigatorEvent):void {
// set the city with data default property of each view
city = data.toString();
myWebView = new StageWebView();
myWebView.stage = this.stage;
// myWebView.loadURL("http://maps.google.com"); // default
myWebView.loadURL("http://maps.google.com/maps?f=q&source=s_q&hl=en&geocode=&q="+ city + "&z=12&sensor=true");
myWebView.viewPort = new Rectangle(0,70,stage.stageWidth,stage.stageHeight);
}
plz help