<commit_before><?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 org.apache.flex.maps.google.models.MapModel;
			import models.MyModel;
			
			import org.apache.flex.events.Event;
			import org.apache.flex.maps.google.Place;
			import org.apache.flex.maps.google.Marker;
			
			private function initControls() : void
			{
				
			}
			
			/**
			 * Called when the map is ready for use. This function adds a variety of event
			 * listners, some of which will trigger a new search.
			 */
			private function onMapReady() : void
			{
				map.addEventListener("centered", onMapCenteredOrChanged);
				map.addEventListener("boundsChanged", onMapCenteredOrChanged);
				map.addEventListener("zoomChanged", onMapCenteredOrChanged);
				map.addEventListener("dragEnd", onMapCenteredOrChanged);
				map.addEventListener("markerClicked", onMarkerClicked);
				
				// Listen for changes to the search results on the map's model.
				map.model.addEventListener("searchResultsChanged", onSearchResults);
			}
			
			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;
				mapLocation.text = MyModel(applicationModel).cities[index];
				codeAddress();
			}
			
			private function codeAddress() : void
			{
				map.markAddress(mapLocation.text);
			}
			
			private function searchOnMap() : void
			{
				map.nearbySearch(search.text);
			}
			
			private function clearSearchResults() : void
			{
				map.clearSearchResults();
			}
			
			private function orientMap() : void
			{
				map.centerOnAddress(mapLocation.text);
			}
			
			/**
			 * Called when the map has been re-centered or moved. The search results are
			 * cleared and a new search is triggered.
			 */
			private function onMapCenteredOrChanged(event:org.apache.flex.events.Event):void
			{
				clearSearchResults();
				if (search.text) searchOnMap();
			}
			
			/**
			 * Called when search results are available in the map's model. This function
			 * transfers those results to the application's model which is bound to the
			 * List component.
			 */
			private function onSearchResults(event:org.apache.flex.events.Event):void
			{
				var searchResults:Array = MapModel(map.model).searchResults;
				MyModel(applicationModel).searchResults = searchResults;
			}
			
			/**
			 * Called when a marker on the map has been selected. This function centers
			 * the map on the marker and, if necessary, zooms the map in for closer
			 * inspection.
			 */
			private function onMarkerClicked(event:org.apache.flex.events.Event):void
			{
				var marker:Marker = map.selectedMarker;
				map.setZoom(12);
				map.setCenter(marker.position);
			}
			
		]]>
	</fx:Script>
	
		<fx:Style>
		@namespace basic "library://ns.apache.org/flexjs/basic";
		
		.FormLabel {
			font-weight: bold;
			font-size: 12;
			padding-left: 20px;
			padding-right: 20px;
			padding-top: 20px;
			padding-bottom: 20px;
			height: 22px;
		}
		
		.FormButton {
			font-weight: bold;
			font-size: 12;
			color: #000000;
			background-color: #FFFFFF;
			border-style: solid;
			padding-top: 5px;
			padding-bottom: 5px;
			padding-left: 5px;
			padding-right: 5px;
		}
		
		.FormInput {
			font-weight: normal;
			font-size: 12;
			color: #0000DE;
			padding: 0px;
			height: 20px;
		}
		
		.InnerBox {
			margin-top: 11px;
			margin-bottom: 10px;
		}
	</fx:Style>
	
	<basic:beads>
		<basic:ViewBaseDataBinding />
	</basic:beads>
	
	
	<basic:Container x="5" y="5" className="topContainer" >
		<basic:beads>
			<basic:NonVirtualVerticalLayout />
		</basic:beads>
		
		<basic:Container className="InnerBox">
			<basic:beads>
				<basic:NonVirtualHorizontalLayout />
			</basic:beads>
			<basic:Label id="label1" text="Location:" className="FormLabel"  />
			<basic:TextInput id="mapLocation" />
			<basic:TextButton text="Go" id="goButton" click="orientMap()" className="FormButton" />
			
			<basic:DropDownList id="list" width="100" height="20"
								change="changeCity(event)"
								dataProvider="{MyModel(applicationModel).cities}" />
		</basic:Container>
		
		<basic:Map id="map" width="450" height="300" className="MainMap"
				   token="<KEY>" 
				   ready="onMapReady()"/>
		
		<basic:Container className="InnerBox">
			<basic:beads>
				<basic:NonVirtualHorizontalLayout />
			</basic:beads>
			<basic:Label id="label2" text="Search on Map:" className="FormLabel" />
			<basic:TextInput id="search" />
			<basic:TextButton text="Find" click="searchOnMap()" className="FormButton" />
			<basic:TextButton text="Clear"click="clearSearchResults()" className="FormButton" />
		</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:Container>
	
</basic:ViewBase>
<commit_msg>Updated MapSearch example to use google.maps.MarkerOptions to debug external-js-lib Falcon option.<commit_after><?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 google.maps.MarkerOptions;

			import org.apache.flex.maps.google.models.MapModel;
			import models.MyModel;
			
			import org.apache.flex.events.Event;
			import org.apache.flex.maps.google.Place;
			import org.apache.flex.maps.google.Marker;
			
			private function initControls() : void
			{
				var mo:MarkerOptions = new MarkerOptions();
				mo.opacity = 0.5;
				trace("Set opacity to "+mo.opacity);
			}
			
			/**
			 * Called when the map is ready for use. This function adds a variety of event
			 * listners, some of which will trigger a new search.
			 */
			private function onMapReady() : void
			{
				map.addEventListener("centered", onMapCenteredOrChanged);
				map.addEventListener("boundsChanged", onMapCenteredOrChanged);
				map.addEventListener("zoomChanged", onMapCenteredOrChanged);
				map.addEventListener("dragEnd", onMapCenteredOrChanged);
				map.addEventListener("markerClicked", onMarkerClicked);
				
				// Listen for changes to the search results on the map's model.
				map.model.addEventListener("searchResultsChanged", onSearchResults);
			}
			
			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;
				mapLocation.text = MyModel(applicationModel).cities[index];
				codeAddress();
			}
			
			private function codeAddress() : void
			{
				map.markAddress(mapLocation.text);
			}
			
			private function searchOnMap() : void
			{
				map.nearbySearch(search.text);
			}
			
			private function clearSearchResults() : void
			{
				map.clearSearchResults();
			}
			
			private function orientMap() : void
			{
				map.centerOnAddress(mapLocation.text);
			}
			
			/**
			 * Called when the map has been re-centered or moved. The search results are
			 * cleared and a new search is triggered.
			 */
			private function onMapCenteredOrChanged(event:org.apache.flex.events.Event):void
			{
				clearSearchResults();
				if (search.text) searchOnMap();
			}
			
			/**
			 * Called when search results are available in the map's model. This function
			 * transfers those results to the application's model which is bound to the
			 * List component.
			 */
			private function onSearchResults(event:org.apache.flex.events.Event):void
			{
				var searchResults:Array = MapModel(map.model).searchResults;
				MyModel(applicationModel).searchResults = searchResults;
			}
			
			/**
			 * Called when a marker on the map has been selected. This function centers
			 * the map on the marker and, if necessary, zooms the map in for closer
			 * inspection.
			 */
			private function onMarkerClicked(event:org.apache.flex.events.Event):void
			{
				var marker:Marker = map.selectedMarker;
				map.setZoom(12);
				map.setCenter(marker.position);
			}
			
		]]>
	</fx:Script>
	
		<fx:Style>
		@namespace basic "library://ns.apache.org/flexjs/basic";
		
		.FormLabel {
			font-weight: bold;
			font-size: 12;
			padding-left: 20px;
			padding-right: 20px;
			padding-top: 20px;
			padding-bottom: 20px;
			height: 22px;
		}
		
		.FormButton {
			font-weight: bold;
			font-size: 12;
			color: #000000;
			background-color: #FFFFFF;
			border-style: solid;
			padding-top: 5px;
			padding-bottom: 5px;
			padding-left: 5px;
			padding-right: 5px;
		}
		
		.FormInput {
			font-weight: normal;
			font-size: 12;
			color: #0000DE;
			padding: 0px;
			height: 20px;
		}
		
		.InnerBox {
			margin-top: 11px;
			margin-bottom: 10px;
		}
	</fx:Style>
	
	<basic:beads>
		<basic:ViewBaseDataBinding />
	</basic:beads>
	
	
	<basic:Container x="5" y="5" className="topContainer" >
		<basic:beads>
			<basic:NonVirtualVerticalLayout />
		</basic:beads>
		
		<basic:Container className="InnerBox">
			<basic:beads>
				<basic:NonVirtualHorizontalLayout />
			</basic:beads>
			<basic:Label id="label1" text="Location:" className="FormLabel"  />
			<basic:TextInput id="mapLocation" />
			<basic:TextButton text="Go" id="goButton" click="orientMap()" className="FormButton" />
			
			<basic:DropDownList id="list" width="100" height="20"
								change="changeCity(event)"
								dataProvider="{MyModel(applicationModel).cities}" />
		</basic:Container>
		
		<basic:Map id="map" width="450" height="300" className="MainMap"
				   token="<KEY>" 
				   ready="onMapReady()"/>
		
		<basic:Container className="InnerBox">
			<basic:beads>
				<basic:NonVirtualHorizontalLayout />
			</basic:beads>
			<basic:Label id="label2" text="Search on Map:" className="FormLabel" />
			<basic:TextInput id="search" />
			<basic:TextButton text="Find" click="searchOnMap()" className="FormButton" />
			<basic:TextButton text="Clear"click="clearSearchResults()" className="FormButton" />
		</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:Container>
	
</basic:ViewBase>

{'fraction_non_alphanumeric': 0.1201730491908348, 'fraction_numerical': 0.011536612722320141, 'mean_word_length': 3.514647377938517, 'pattern_counts': {'":': 0, '<': 87, '<?xml version=': 2, '>': 87, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 12}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '920344', 'n_tokens_mistral': 4718, 'n_tokens_neox': 3682, 'n_words': 960}