You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by pe...@apache.org on 2014/06/02 23:10:07 UTC
git commit: [flex-asjs] [refs/heads/develop] - Added MapSearch
example.
Repository: flex-asjs
Updated Branches:
refs/heads/develop 4819f8f5e -> 90d6f595c
Added MapSearch example.
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/90d6f595
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/90d6f595
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/90d6f595
Branch: refs/heads/develop
Commit: 90d6f595cac8b42fa1c24792b09d270941c37c41
Parents: 4819f8f
Author: Peter Ent <pe...@apache.org>
Authored: Mon Jun 2 17:09:52 2014 -0400
Committer: Peter Ent <pe...@apache.org>
Committed: Mon Jun 2 17:09:52 2014 -0400
----------------------------------------------------------------------
examples/MapSearch/MapSearch-app.xml | 252 +++++++++++++++++++
examples/MapSearch/build.xml | 77 ++++++
examples/MapSearch/src/MapSearch.mxml | 46 ++++
examples/MapSearch/src/MyInitialView.mxml | 181 +++++++++++++
examples/MapSearch/src/models/MyModel.as | 69 +++++
examples/build.xml | 2 +
.../src/org/apache/flex/maps/google/Place.js | 8 +-
7 files changed, 633 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/90d6f595/examples/MapSearch/MapSearch-app.xml
----------------------------------------------------------------------
diff --git a/examples/MapSearch/MapSearch-app.xml b/examples/MapSearch/MapSearch-app.xml
new file mode 100644
index 0000000..5cf1d99
--- /dev/null
+++ b/examples/MapSearch/MapSearch-app.xml
@@ -0,0 +1,252 @@
+<?xml version="1.0" encoding="utf-8" standalone="no"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+<application xmlns="http://ns.adobe.com/air/application/4.0">
+
+<!-- Adobe AIR Application Descriptor File Template.
+
+ Specifies parameters for identifying, installing, and launching AIR applications.
+
+ xmlns - The Adobe AIR namespace: http://ns.adobe.com/air/application/3.8
+ The last segment of the namespace specifies the version
+ of the AIR runtime required for this application to run.
+
+ minimumPatchLevel - The minimum patch level of the AIR runtime required to run
+ the application. Optional.
+-->
+
+ <!-- A universally unique application identifier. Must be unique across all AIR applications.
+ Using a reverse DNS-style name as the id is recommended. (Eg. com.example.ExampleApplication.) Required. -->
+ <id>org.apache.flexjs.mapsearch</id>
+
+ <!-- Used as the filename for the application. Required. -->
+ <filename>Apache FlexJS Google Map Example</filename>
+
+ <!-- The name that is displayed in the AIR application installer.
+ May have multiple values for each language. See samples or xsd schema file. Optional. -->
+ <name>Apache FlexJS Google Map Example</name>
+
+ <!-- A string value of the format <0-999>.<0-999>.<0-999> that represents application version which can be used to check for application upgrade.
+ Values can also be 1-part or 2-part. It is not necessary to have a 3-part value.
+ An updated version of application must have a versionNumber value higher than the previous version. Required for namespace >= 2.5 . -->
+ <versionNumber>0.0.1</versionNumber>
+
+ <!-- A string value (such as "v1", "2.5", or "Alpha 1") that represents the version of the application, as it should be shown to users. Optional. -->
+ <!-- <versionLabel></versionLabel> -->
+
+ <!-- Description, displayed in the AIR application installer.
+ May have multiple values for each language. See samples or xsd schema file. Optional. -->
+ <!-- <description></description> -->
+
+ <!-- Copyright information. Optional -->
+ <copyright>Copyright 2013 The Apache Software Foundation.</copyright>
+
+ <!-- Publisher ID. Used if you're updating an application created prior to 1.5.3 -->
+ <!-- <publisherID></publisherID> -->
+
+ <!-- Settings for the application's initial window. Required. -->
+ <initialWindow>
+ <!-- The main SWF or HTML file of the application. Required. -->
+ <!-- Note: In Flash Builder, the SWF reference is set automatically. -->
+ <content>MapSearch.swf</content>
+
+ <!-- The title of the main window. Optional. -->
+ <!-- <title></title> -->
+
+ <!-- The type of system chrome to use (either "standard" or "none"). Optional. Default standard. -->
+ <!-- <systemChrome></systemChrome> -->
+
+ <!-- Whether the window is transparent. Only applicable when systemChrome is none. Optional. Default false. -->
+ <!-- <transparent></transparent> -->
+
+ <!-- Whether the window is initially visible. Optional. Default false. -->
+ <!--<visible></visible>-->
+
+ <!-- Whether the user can minimize the window. Optional. Default true. -->
+ <!-- <minimizable></minimizable> -->
+
+ <!-- Whether the user can maximize the window. Optional. Default true. -->
+ <!-- <maximizable></maximizable> -->
+
+ <!-- Whether the user can resize the window. Optional. Default true. -->
+ <!-- <resizable></resizable> -->
+
+ <!-- The window's initial width in pixels. Optional. -->
+ <width>455</width>
+
+ <!-- The window's initial height in pixels. Optional. -->
+ <height>605</height>
+
+ <!-- The window's initial x position. Optional. -->
+ <!-- <x></x> -->
+
+ <!-- The window's initial y position. Optional. -->
+ <!-- <y></y> -->
+
+ <!-- The window's minimum size, specified as a width/height pair in pixels, such as "400 200". Optional. -->
+ <!-- <minSize></minSize> -->
+
+ <!-- The window's initial maximum size, specified as a width/height pair in pixels, such as "1600 1200". Optional. -->
+ <!-- <maxSize></maxSize> -->
+
+ <!-- The initial aspect ratio of the app when launched (either "portrait" or "landscape"). Optional. Mobile only. Default is the natural orientation of the device -->
+
+ <!-- <aspectRatio></aspectRatio> -->
+
+ <!-- Whether the app will begin auto-orienting on launch. Optional. Mobile only. Default false -->
+
+ <!-- <autoOrients></autoOrients> -->
+
+ <!-- Whether the app launches in full screen. Optional. Mobile only. Default false -->
+
+ <!-- <fullScreen></fullScreen> -->
+
+ <!-- The render mode for the app (either auto, cpu, gpu, or direct). Optional. Default auto -->
+
+ <!-- <renderMode></renderMode> -->
+
+ <!-- Whether or not to pan when a soft keyboard is raised or lowered (either "pan" or "none"). Optional. Defaults "pan." -->
+ <!-- <softKeyboardBehavior></softKeyboardBehavior> -->
+ <autoOrients>false</autoOrients>
+ <fullScreen>false</fullScreen>
+ <visible>true</visible>
+ </initialWindow>
+
+ <!-- We recommend omitting the supportedProfiles element, -->
+ <!-- which in turn permits your application to be deployed to all -->
+ <!-- devices supported by AIR. If you wish to restrict deployment -->
+ <!-- (i.e., to only mobile devices) then add this element and list -->
+ <!-- only the profiles which your application does support. -->
+ <!-- <supportedProfiles>desktop extendedDesktop mobileDevice extendedMobileDevice</supportedProfiles> -->
+ <supportedProfiles>extendedDesktop desktop</supportedProfiles>
+
+ <!-- The subpath of the standard default installation location to use. Optional. -->
+ <installFolder>Apache Flex</installFolder>
+
+ <!-- The subpath of the Programs menu to use. (Ignored on operating systems without a Programs menu.) Optional. -->
+ <programMenuFolder>Apache Flex</programMenuFolder>
+
+ <!-- The icon the system uses for the application. For at least one resolution,
+ specify the path to a PNG file included in the AIR package. Optional. -->
+ <icon>
+ <image16x16>assets/icons/16.png</image16x16>
+ <image29x29>assets/icons/29.png</image29x29>
+ <image32x32>assets/icons/32.png</image32x32>
+ <image36x36>assets/icons/36.png</image36x36>
+ <image48x48>assets/icons/48.png</image48x48>
+ <image57x57>assets/icons/57.png</image57x57>
+ <image72x72>assets/icons/72.png</image72x72>
+ <image114x114>assets/icons/114.png</image114x114>
+ <image128x128>assets/icons/128.png</image128x128>
+ </icon>
+
+ <!-- Whether the application handles the update when a user double-clicks an update version
+ of the AIR file (true), or the default AIR application installer handles the update (false).
+ Optional. Default false. -->
+ <!-- <customUpdateUI></customUpdateUI> -->
+
+ <!-- Whether the application can be launched when the user clicks a link in a web browser.
+ Optional. Default false. -->
+ <!-- <allowBrowserInvocation></allowBrowserInvocation> -->
+
+ <!-- Listing of file types for which the application can register. Optional. -->
+ <!-- <fileTypes> -->
+
+ <!-- Defines one file type. Optional. -->
+ <!-- <fileType> -->
+
+ <!-- The name that the system displays for the registered file type. Required. -->
+ <!-- <name></name> -->
+
+ <!-- The extension to register. Required. -->
+ <!-- <extension></extension> -->
+
+ <!-- The description of the file type. Optional. -->
+ <!-- <description></description> -->
+
+ <!-- The MIME content type. -->
+ <!-- <contentType></contentType> -->
+
+ <!-- The icon to display for the file type. Optional. -->
+ <!-- <icon>
+ <image16x16></image16x16>
+ <image32x32></image32x32>
+ <image48x48></image48x48>
+ <image128x128></image128x128>
+ </icon> -->
+
+ <!-- </fileType> -->
+ <!-- </fileTypes> -->
+
+ <!-- iOS specific capabilities -->
+ <!-- <iPhone> -->
+ <!-- A list of plist key/value pairs to be added to the application Info.plist -->
+ <!-- <InfoAdditions>
+ <![CDATA[
+ <key>UIDeviceFamily</key>
+ <array>
+ <string>1</string>
+ <string>2</string>
+ </array>
+ <key>UIStatusBarStyle</key>
+ <string>UIStatusBarStyleBlackOpaque</string>
+ <key>UIRequiresPersistentWiFi</key>
+ <string>YES</string>
+ ]]>
+ </InfoAdditions> -->
+ <!-- A list of plist key/value pairs to be added to the application Entitlements.plist -->
+ <!-- <Entitlements>
+ <![CDATA[
+ <key>keychain-access-groups</key>
+ <array>
+ <string></string>
+ <string></string>
+ </array>
+ ]]>
+ </Entitlements> -->
+ <!-- Display Resolution for the app (either "standard" or "high"). Optional. Default "standard" -->
+ <!-- <requestedDisplayResolution></requestedDisplayResolution> -->
+ <!-- </iPhone> -->
+
+ <!-- Specify Android specific tags that get passed to AndroidManifest.xml file. -->
+ <!--<android> -->
+ <!-- <manifestAdditions>
+ <![CDATA[
+ <manifest android:installLocation="auto">
+ <uses-permission android:name="android.permission.INTERNET"/>
+ <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
+ <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
+ <uses-feature android:required="true" android:name="android.hardware.touchscreen.multitouch"/>
+ <application android:enabled="true">
+ <activity android:excludeFromRecents="false">
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN"/>
+ <category android:name="android.intent.category.LAUNCHER"/>
+ </intent-filter>
+ </activity>
+ </application>
+ </manifest>
+ ]]>
+ </manifestAdditions> -->
+ <!-- Color depth for the app (either "32bit" or "16bit"). Optional. Default 16bit before namespace 3.0, 32bit after -->
+ <!-- <colorDepth></colorDepth> -->
+ <!-- </android> -->
+ <!-- End of the schema for adding the android specific tags in AndroidManifest.xml file -->
+
+</application>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/90d6f595/examples/MapSearch/build.xml
----------------------------------------------------------------------
diff --git a/examples/MapSearch/build.xml b/examples/MapSearch/build.xml
new file mode 100644
index 0000000..cf6df2e
--- /dev/null
+++ b/examples/MapSearch/build.xml
@@ -0,0 +1,77 @@
+<?xml version="1.0"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+
+
+<project name="mapsearch" default="main" basedir=".">
+ <property name="FLEXJS_HOME" location="../.."/>
+ <property name="example" value="MapSearch" />
+
+ <!-- this project needs AIR 3.4 FP 11.4 -->
+ <property name="swf.version" value="17" />
+ <property name="playerglobal.version" value="11.4" />
+
+ <property file="${FLEXJS_HOME}/env.properties"/>
+ <property environment="env"/>
+ <property file="${FLEXJS_HOME}/build.properties"/>
+ <property name="FLEX_HOME" value="${FLEXJS_HOME}"/>
+ <property name="FALCON_HOME" value="${env.FALCON_HOME}"/>
+ <property name="FALCONJX_HOME" value="${env.FALCONJX_HOME}"/>
+ <property name="GOOG_HOME" value="${env.GOOG_HOME}"/>
+ <property name="AIR_HOME" value="${env.AIR_HOME}"/>
+
+
+ <condition property="adl" value="adl.exe">
+ <os family="windows"/>
+ </condition>
+
+ <condition property="adl" value="adl">
+ <os family="mac"/>
+ </condition>
+
+ <condition property="runtime" value="win">
+ <os family="windows"/>
+ </condition>
+
+ <condition property="runtime" value="mac">
+ <os family="mac"/>
+ </condition>
+
+ <include file="${basedir}/../build_example.xml" />
+
+ <target name="main" depends="clean,build_example.compileair,build_example.compilejsair" description="Clean build of ${example}">
+ </target>
+
+ <target name="clean">
+ <echo>playerglobal.version = ${playerglobal.version}</echo>
+ <delete dir="${basedir}/bin" failonerror="false" />
+ <delete dir="${basedir}/bin-debug" failonerror="false" />
+ <delete dir="${basedir}/bin-release" failonerror="false" />
+ </target>
+
+ <target name="run">
+ <exec executable="${AIR_HOME}/bin/${adl}" dir="${basedir}/bin-debug" failonerror="true">
+ <arg value="-runtime" />
+ <arg value="${AIR_HOME}/runtimes/air/${runtime}" />
+ <arg value="-profile" />
+ <arg value="extendedDesktop" />
+ <arg value="${basedir}/bin-debug/${example}-app.xml" />
+ </exec>
+ </target>
+</project>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/90d6f595/examples/MapSearch/src/MapSearch.mxml
----------------------------------------------------------------------
diff --git a/examples/MapSearch/src/MapSearch.mxml b/examples/MapSearch/src/MapSearch.mxml
new file mode 100644
index 0000000..86b9f28
--- /dev/null
+++ b/examples/MapSearch/src/MapSearch.mxml
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!---
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+-->
+<basic:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
+ xmlns:local="*"
+ xmlns:models="models.*"
+ xmlns:basic="library://ns.apache.org/flexjs/basic"
+ >
+
+ <!-- This application demonstrates how to use the Google MAP API
+ on both the AIR and JavaScript/browser platform. After cross-
+ compiling this application for JavaScript, edit the index.html
+ file and include your Google developer API token.
+ -->
+
+ <basic:valuesImpl>
+ <basic:SimpleCSSValuesImpl />
+ </basic:valuesImpl>
+ <basic:initialView>
+ <local:MyInitialView />
+ </basic:initialView>
+ <basic:model>
+ <models:MyModel />
+ </basic:model>
+ <basic:beads>
+ <basic:MixinManager />
+ </basic:beads>
+
+</basic:Application>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/90d6f595/examples/MapSearch/src/MyInitialView.mxml
----------------------------------------------------------------------
diff --git a/examples/MapSearch/src/MyInitialView.mxml b/examples/MapSearch/src/MyInitialView.mxml
new file mode 100644
index 0000000..3478abd
--- /dev/null
+++ b/examples/MapSearch/src/MyInitialView.mxml
@@ -0,0 +1,181 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements. See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License. You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+-->
+<basic:ViewBase xmlns:fx="http://ns.adobe.com/mxml/2009"
+ xmlns:basic="library://ns.apache.org/flexjs/basic"
+ xmlns:mx="library://ns.adobe.com/flex/mx"
+ xmlns:local="*"
+ initComplete="initControls()">
+ <fx:Script>
+ <![CDATA[
+ import models.MyModel;
+
+ import org.apache.flex.events.Event;
+ import org.apache.flex.maps.google.Place;
+
+ private function initControls() : void
+ {
+
+ }
+
+ private function onMapReady() : void
+ {
+ map.addEventListener("searchResult",onSearchResults);
+ map.addEventListener("centered", onMapCenteredOrChanged);
+ map.addEventListener("boundsChanged", onMapCenteredOrChanged);
+ map.addEventListener("zoomChanged", onMapCenteredOrChanged);
+ map.addEventListener("dragEnd", onMapCenteredOrChanged);
+ }
+
+ /**
+ * Take the values from the input field and have the map
+ * display that coordinate.
+ */
+ private function mapIt() : void
+ {
+// var lat:Number = Number(latInput.text);
+// var lng:Number = Number(longInput.text);
+// var zoom:Number = Number(zoomInput.text);
+
+// map.loadMap(lat, lng, zoom);
+ }
+
+ private var selectedCity:String;
+
+ /**
+ * Triggered by a change in the drop list with a new city selected. This
+ * will also update the input fields.
+ */
+ private function changeCity(event:org.apache.flex.events.Event) : void
+ {
+ var index:int = list.selectedIndex;
+
+ var latlng:Object = MyModel(applicationModel).coordinates[index];
+ map.loadMap(latlng.lat, latlng.lng, 10);
+ }
+
+ private function codeAddress() : void
+ {
+ map.markAddress(mapLocation.text);
+ //map.setZoom(12);
+ }
+
+ private function searchOnMap() : void
+ {
+ map.nearbySearch(search.text);
+ //map.setZoom(12);
+ }
+
+ private function clearSearchResults() : void
+ {
+ map.clearSearchResults();
+ MyModel(applicationModel).searchResults = new Array();
+ }
+
+ private function orientMap() : void
+ {
+ map.centerOnAddress(mapLocation.text);
+ //map.setZoom(12);
+ }
+
+ private function onMapCenteredOrChanged(event:org.apache.flex.events.Event):void
+ {
+ trace("Returned event of type: "+event.type);
+ clearSearchResults();
+ if (search.text) searchOnMap();
+ }
+
+ private function onSearchResults(event:org.apache.flex.events.Event):void
+ {
+ trace("Received search results!");
+ MyModel(applicationModel).searchResults = map.searchResults;
+ trace("--- there are "+MyModel(applicationModel).searchResults.length+" results");
+ for(var i:int=0; i < MyModel(applicationModel).searchResults.length; i++) {
+ var place:Place = MyModel(applicationModel).searchResults[i] as Place;
+ trace(place.name+" @ "+place.vicinity);
+ }
+ }
+
+ ]]>
+ </fx:Script>
+
+ <fx:Style>
+ @namespace basic "library://ns.apache.org/flexjs/basic";
+
+ </fx:Style>
+
+ <basic:beads>
+ <basic:ViewBaseDataBinding />
+ </basic:beads>
+
+
+ <basic:Container x="5" y="5" className="topContainer" >
+ <basic:beads>
+ <basic:NonVirtualVerticalLayout />
+ </basic:beads>
+
+ <basic:Container>
+ <basic:beads>
+ <basic:NonVirtualHorizontalLayout />
+ </basic:beads>
+ <basic:Label text="Location:" />
+ <basic:TextInput id="mapLocation" />
+ <basic:TextButton text="Go" click="orientMap()" />
+
+ <basic:DropDownList id="list" width="100" height="17"
+ change="changeCity(event)"
+ dataProvider="{MyModel(applicationModel).cities}" />
+ </basic:Container>
+
+ <basic:Map id="map" width="450" height="300" token="AIzaSyDkQgg2iojLCYeuW6hK7DkuAHD-SwJJhdE" ready="onMapReady()"/>
+
+ <basic:Container>
+ <basic:beads>
+ <basic:NonVirtualHorizontalLayout />
+ </basic:beads>
+ <basic:Label text="Search on Map:" />
+ <basic:TextInput id="search" />
+ <basic:TextButton text="Find" click="searchOnMap()" />
+ <basic:TextButton text="Clear" click="clearSearchResults()" />
+ </basic:Container>
+
+ <basic:List id="resultsList" width="450" height="200">
+ <basic:beads>
+ <basic:SimpleBinding
+ sourceID="applicationModel"
+ sourcePropertyName="searchResults"
+ eventName="searchResultsChanged"
+ destinationPropertyName="dataProvider" />
+ </basic:beads>
+ </basic:List>
+
+<!-- <basic:Label text="Lat:" />
+ <basic:TextInput id="latInput" text="-34.397" />
+
+ <basic:Label text="Long:" />
+ <basic:TextInput id="longInput" text="150.644" />
+
+ <basic:Label text="Zoom:" />
+ <basic:TextInput id="zoomInput" text="8" />
+
+ <basic:TextButton text="MapIt" click="mapIt()" /> -->
+
+ </basic:Container>
+
+</basic:ViewBase>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/90d6f595/examples/MapSearch/src/models/MyModel.as
----------------------------------------------------------------------
diff --git a/examples/MapSearch/src/models/MyModel.as b/examples/MapSearch/src/models/MyModel.as
new file mode 100644
index 0000000..528da95
--- /dev/null
+++ b/examples/MapSearch/src/models/MyModel.as
@@ -0,0 +1,69 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package models
+{
+ import org.apache.flex.core.IBeadModel;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.events.EventDispatcher;
+
+ public class MyModel extends EventDispatcher implements IBeadModel
+ {
+ public function MyModel()
+ {
+ super();
+ }
+
+ private var _strand:IStrand;
+
+ public function set strand(value:IStrand):void
+ {
+ _strand = value;
+ }
+
+ private var _cities:Array = ["Sydney", "NYC", "Mexico City", "London", "Rio de Janeiro"];
+ public function get cities():Array
+ {
+ return _cities;
+ }
+
+ private var _coordinates:Array = [{lat:-33.86, lng:151.211},
+ {lat:40.712, lng:-74.0059},
+ {lat:19.26, lng:-99.03},
+ {lat:51.4, lng:-0.1},
+ {lat:-22.95, lng:-43.12}];
+ public function get coordinates():Array
+ {
+ return _coordinates;
+ }
+
+ private var _searchResults:Array = [];
+
+ [Bindable("searchResultsChanged")]
+ public function get searchResults():Array
+ {
+ return _searchResults;
+ }
+ public function set searchResults(value:Array):void
+ {
+ _searchResults = value;
+ dispatchEvent(new Event("searchResultsChanged"));
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/90d6f595/examples/build.xml
----------------------------------------------------------------------
diff --git a/examples/build.xml b/examples/build.xml
index 880bf38..ba05600 100644
--- a/examples/build.xml
+++ b/examples/build.xml
@@ -89,6 +89,7 @@
<ant dir="${basedir}/FormExample"/>
<ant dir="${basedir}/LanguageTests"/>
<ant dir="${basedir}/ListsTest"/>
+ <ant dir="${basedir}/MapSearch"/>
<ant dir="${basedir}/MobileTrader"/>
<ant dir="${basedir}/StatesTest"/>
<ant dir="${basedir}/StockQuote"/>
@@ -122,6 +123,7 @@
<ant dir="${basedir}/FormExample" target="clean"/>
<ant dir="${basedir}/LanguageTests" target="clean"/>
<ant dir="${basedir}/ListsTest" target="clean"/>
+ <ant dir="${basedir}/MapSearch" target="clean"/>
<ant dir="${basedir}/StatesTest" target="clean"/>
<ant dir="${basedir}/StockQuote" target="clean"/>
<ant dir="${basedir}/BarChartExample" target="clean"/>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/90d6f595/frameworks/js/FlexJS/src/org/apache/flex/maps/google/Place.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/maps/google/Place.js b/frameworks/js/FlexJS/src/org/apache/flex/maps/google/Place.js
index f2f3143..87c2eda 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/maps/google/Place.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/maps/google/Place.js
@@ -80,9 +80,13 @@ org.apache.flex.maps.google.Place.prototype.vicinity = null;
/**
- * @return {String} A description of the area of the place.
+ * @override
+ * @return {string} A description of the area of the place.
*/
org.apache.flex.maps.google.Place.prototype.toString = function() {
- return this.name;
+ var results = '';
+ if (this.name) results = this.name;
+ if (this.vicinity) results += ' ' + this.vicinity;
+ return results;
};