YahooMap works in FLEX3

SpringBoot+Vue+Mysql社区医院信息平台(源码+文档) SpringBoot+Vue+Mysql学生宿舍信息管理系统 WEB端软件项目(源码+文档) 项目包含:①完整源码(后端+管理后台+用户前台);②数据库脚本文件;③万字论文文档;④开题报告;⑤答辩PPT;⑥项目运行视频教程。 项目架构: B/S 架构、MVC 分层设计 技术栈: Java、MySQL、SpringBoot、MyBatis-Plus、Token 权限校验、管理后台 Vue+ElementUI+ECharts、用户前台 Layui+jQuery、Maven 构建。 一、角色设计 学生用户: 注册登录、浏览宿舍信息、查询宿舍安排、在线报修、缴费查询、失物招领、桶装水预订、评论交流、收藏等。 商家用户: 注册登录、桶装水品牌与商品信息维护、预订订单查看与处理。 维修人员: 注册登录、查看待处理报修、接单维修、填写报修处理结果与进度反馈。 管理员: 学生管理、班级管理、宿舍信息管理、宿舍安排管理、报修处理管理、缴费信息管理、卫生检查与文明宿舍管理、失物招领管理、桶装水与商家管理、维修人员管理、公告资讯与轮播图管理等。 二、前台功能模块(学生端) 1. 首页展示:轮播图、宿舍公告、最新动态推荐、常用服务快速入口 2. 宿舍信息模块:宿舍列表、楼栋与房间条件筛选、宿舍详情查看、我的宿舍安排查询 3. 在线报修模块:在线提交宿舍设施报修申请、上传故障描述、查看报修进度与维修处理结果 4. 缴费模块:水电等缴费记录查询、缴费状态查看 5. 卫生检查与文明宿舍:宿舍卫生检查结果公示、文明宿舍展示 6. 失物招领模块:失物信息发布、招领信息发布、详情查看、评论互动 7. 桶装水预订:桶装水品牌与商品浏览、在线预订、我的预订记录查询 8. 假期留宿:假期留校申请提交、申请记录查询 9. 评论与收藏:信息评论、查看他人评论、评论回复互动、收藏感兴趣的内容 10. 个人中心... 立即下载
Notes about the sample code in this article:
  • The examples in the article are full copy-and-paste code excerpts. While I encourage you to add your own elements, I wanted to provide you with as much of a head start as possible.
  • To implement all the code examples, you can simply add them into a basic MXML file. Certain elements will be written in <mx:Script> tags like event handling and other elements will be called from Flex 2 components via click events etc.
The Basics: Architecture and Setup

Let's start at the very beginning (a very good place to start).

Overview of the architecture
  1. Look at the examples folder in the AS3 Library distribution you downloaded and installed (if you haven't yet, refer to the link in the "What You Need" section above.) In examples/traffic and examples/pipes, you will notice a swf file named as2map.swf. This file contains the AS2 Yahoo! Maps component. You shouldn't have to touch this file; however, if you need to, the source file is in the source/as2 directory, named as2map.fla. If you make any changes, make sure you update the compile path, so that the updated swf overwrites the swf file with the same name in your applications root directory.
  2. Inside the source folder, there are two subdirectories, as2 and as3. Both of these ActionScript-versioned directories contain separate classes, but share the same namespace. Again, in most cases you won't have to make any changes, though we encourage you to expand any of the classes with whatever functionality you deem necessary for your application.
  3. Some of the code lives on the first frame of the as2map.fla. Normally, I don't like having any code on the timeline (other than using an #include directive), in this case I had no choice. In order to access features and events inside the compiled as2 component I had to use the full class path (i.e. com.yahoo.maps.api.flash.YahooMap.EVENT_ZOOM_START), and since these paths don't exist in my class structure, the compiler produced errors.
  4. Both the AS2 and AS3 class paths have some similarities. You will notice com.yahoo.webapis.maps.utils.ExternalInterfaceBuffer exists in both class paths. This is the file that both AVM's communicate through. Since the AS2 and AS3 portions of this application are running in separate AVM's, you need not worry about collisions.
  5. Lastly, the example MXML files we will create will end up in the root of the source/as3/ folder.

 

Let's setup the application:

Make sure that you've followed the instructions on how to set up the Yahoo! AS3 Libraries.

Next, we need to add in the Yahoo! namespace to the mx:Application tag so that the tag looks like this:

 

  1. <mx:Application      
  2.   
  3.     xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:yahoo="com.yahoo.webapis.maps.*"  
  4.   
  5.     layout="absolute">    

 

Next, we'll need to set a few constants that are needed to enable seamless communication between the two AVM's. The first constant that I called SWFDOMID is a String and has to have the same value as the object/embed id/name attribute used within the HTML file that houses this application. This constant is used to send method calls and events through the Flash Player's ExternalInterface. The ExternalInterface uses Javascript as its method of communication, and the Javascript needs to know what to target in the DOM of the current page. If this is a little confusing, don't worry, you won't have to deal with this. There is unfortunately no other way to access the object/embed id/name directly with ActionScript. If you were so inclined, you could use Javascript to pass in the object/embed id/name with flashvars; however, for the purpose of this example, we'll just define it as a constant.

The second constant that's needed for this project is a unique integer identifier, named UNIQUEID. This id is appended to all communication between the AVM's, to ensure there is never a collision if multiple instances of the same application are running on a machine. This is even more important if you are using the LocalConnection method, but can come in handy if two SWFs on the same page have the same object/embed id/name.

The third constant that needs to be set is your Yahoo! API Key. Let's name this one YAHOOAPIKEY. This key is needed to access any publicly available data through the Yahoo! API. If you don't have one, go here, it only takes a minute.

The last constant, named MAPSWF, will contain the filename (and path, if necessary) of the as2maps.swf file.

Now, let's set these. All of these variables will be constants, so we can bind them to the YahooMapsService. By default, the HTML page that Flex Builder generates uses the project name as the default object/embed id/name, so let's use that in our example, as we don't want to edit any HTML in this tutorial. To generate the second constant (UNIQUEID), I use the getTimer() method to produce a unique integer based on the number of milliseconds elapsed since the app started running. This is ActionScript 3, so don't forget to import mx.utils.getTimer. There exists a very small probability that that two getTimers() return the exact same millisecond value (they would have to run in very close succession), which in turn will cause communication collisions. It's not a risky gamble, but feel free to spice up the UNIQUEID generation as you see fit. Now your MXML should look something like this:

 

  1. <?xml version="1.0" encoding="utf-8"?>     
  2.   
  3. <mx:Application      
  4.   
  5.     xmlns:mx="http://www.adobe.com/2006/mxml"  xmlns:yahoo="com.yahoo.webapis.maps.*"      
  6.   
  7.     layout="absolute">     
  8.   
  9. <mx:Script>     
  10.   
  11.    <![CDATA[     
  12.   
  13.       import flash.utils.getTimer;     
  14.   
  15.              
  16.   
  17.       private const SWFDOMID:String = "YahooAS3Maps";     
  18.   
  19.       private const UNIQUEID:int = getTimer();     
  20.   
  21.       private const YAHOOAPIKEY:String = "InsertYourAPIKeyHere";     
  22.   
  23.       private const MAPSWF:String = "as2map.swf";     
  24.   
  25.    ]]>     
  26.   
  27. </mx:Script>         
  28.   
  29. </mx:Application>     

 

Now all that is left to set up this project is to actually load the map into our application. This is done with one simple line of MXML. Just add a yahoo:YahooMapService tag into your application, like so:

In most cases, you will want to be notified when the map is loaded and, more importantly, when it's not loaded. This can all be done using events. Now, these, and all events we will use in this project, are no ordinary events. These are events that are broadcast from the AS2 map component and passed through the Yahoo! AS3 Maps Communication Kit. Don't be afraid, you will use them as you would a regular event. That's the beauty of this Communication Kit: the work is done for you, and you can concentrate on creating the best possible Yahoo! Maps application.

Let's start by specifying a creationComplete method that gets triggered when the application has initialized. To do this we just add a creationComplete attribute to the mx:Application tag, like so:

 

  1. <?xml version="1.0" encoding="utf-8"?>     
  2.   
  3. <mx:Application      
  4.   
  5.     xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:yahoo="com.yahoo.webapis.maps.*"      
  6.   
  7.     layout="absolute">     
  8.   
  9. <mx:Script>     
  10.   
  11.    <![CDATA[     
  12.   
  13.       import flash.utils.getTimer;     
  14.   
  15.              
  16.   
  17.       private const SWFDOMID:String = "YahooAS3Maps";     
  18.   
  19.       private const UNIQUEID:int = getTimer();     
  20.   
  21.       private const YAHOOAPIKEY:String = "InsertYourAPIKeyHere";     
  22.   
  23.       private const MAPSWF:String = "as2map.swf";     
  24.   
  25.    ]]>     
  26.   
  27. </mx:Script>         
  28.   
  29. <yahoo:YahooMapService id="swfLoader" UUID="{UNIQUEID}"      
  30.   
  31.     swfDomId="{SWFDOMID}" apiId="{YAHOOAPIKEY}" mapURL = "{MAPSWF}"      
  32.   
  33.     horizontalCenter="0" verticalCenter="0" width="600" height="400" />      
  34.   
  35. </mx:Application>  

 

At this point, you can go ahead and test your project. You should see a Yahoo! map loaded into a Flex 2 application. Not impressed? All right, then it's time for fun stuff:

Loading Events: Let me know when the map is loaded

In most cases, you will want to be notified when the map is loaded and, more importantly, when it's not loaded. This can all be done using events. Now, these, and all events we will use in this project, are no ordinary events. These are events that are broadcast from the AS2 map component and passed through the Yahoo! AS3 Maps Communication Kit. Don't be afraid, you will use them as you would a regular event. That's the beauty of this Communication Kit: the work is done for you, and you can concentrate on creating the best possible Yahoo! Maps application.

Let's start by specifying a creationComplete method that gets triggered when the application has initialized. To do this we just add a creationComplete attribute to the mx:Application tag, like so:

 

  1. public function tokenLoaded(evtObject:Object) : void {     
  2.   
  3. <mx:Application      
  4.   
  5.     xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:yahoo="com.yahoo.webapis.maps.*"      
  6.   
  7.     layout="absolute" creationComplete="init();" >  

 

Next, let's add the init method that gets called when the application is initialized. Inside that method, we will listen for two events, onMapLoad and onMapError. Lastly, let's set up the methods that get called when these methods get triggered. Don't forget to import the Alert control, you will notice that it's being used in the error handler. Your mx:Script content should now look like this:

 

  1.     
  2.   
  3. <mx:Script>     
  4.   
  5.    <![CDATA[     
  6.   
  7.       import flash.utils.getTimer;     
  8.   
  9.       import mx.controls.Alert;     
  10.   
  11.     
  12.   
  13.       private const SWFDOMID:String = "YahooAS3Maps";     
  14.   
  15.       private const UNIQUEID:int = getTimer();     
  16.   
  17.       private const YAHOOAPIKEY:String = "InsertYourAPIKeyHere";     
  18.   
  19.       private const MAPSWF:String = "as2map.swf";     
  20.   
  21.     
  22.   
  23.       private function init():void {     
  24.   
  25.          myAS2Map.addEventListener('onMapLoad', onMapLoaded);     
  26.   
  27.          myAS2Map.addEventListener('onMapError', onMapError);     
  28.   
  29.       }     
  30.   
  31.     
  32.   
  33.       private function onMapLoaded(ev:Object):void {     
  34.   
  35.                  
  36.   
  37.       }     
  38.   
  39.     
  40.   
  41.       private function onMapError(errorCode:String, httpStatus:String):void {     
  42.   
  43.          Alert.show(errorCode + '/n' + httpStatus, 'Load Error');     
  44.   
  45.       }     
  46.   
  47.    ]]>     
  48.   
  49. </mx:Script>    

 

Now that we have an event telling us when the map is loaded, let's do something with it.

Calling Map Methods: How do I call Yahoo! Map methods?

 

Setting up panning:
So now that our map is loaded, and we have an event telling us that it is loaded, it's time to add some functionality to it. The map is pretty boring if you can't drag it around to see more of it. To turn on panning, we will instantiate the PanTools class and call the setPanTool method. Since we can't access any map classes until the map is loaded, let's instantiate the PanTools in our onMapLoaded method:

 

  1.      
  2.   
  3. private function onMapLoaded(ev:Object):void {     
  4.   
  5.    var panTools:PanTool = new PanTool(myAS2Map);     
  6.   
  7.    panTools.setPanTool(true);   
  8.   
  9. }       

 

That's it (honestly, you aren't being punked)! Go ahead, test it. You can now drag to all corners of the Earth (Christopher Columbus would have a field day with this.)

 

What about all those other tools that are available on Yahoo! Maps:
Ah, you mean the Widgets. Fortunately, they are just as easy to setup. Let's add two of the most popular tools available in the Yahoo! Maps component. The NavigatorControl, and the SatelliteControl. The SatelliteControl allows you to toggle between three different views: Map view, Hybrid view, and everyone's favorite Satellite view. The NavigatorControl loads a slider tool that is used for zooming in and out. The NavigatorControl also includes a small interactive navigator widget that can be opened and closed at any time. These tools can be turned on or off by calling methods in the Widgets class. Just like above, let's instantiate the Widgets class in our onMapLoaded method:

 

  1.      
  2.   
  3. private function onMapLoaded(ev:Object):void {     
  4.   
  5.    var panTools:PanTool = new PanTool(myAS2Map);     
  6.   
  7.    panTools.setPanTool(true);     
  8.   
  9.         
  10.   
  11.    var widgets:Widgets = new Widgets(myAS2Map);     
  12.   
  13.    widgets.showNavigatorWidget(true);     
  14.   
  15.    widgets.showSatelliteControlWidget(true);     
  16.   
  17. }    

 

See, it really is as easy as it seems.

 

How about those cool overlays, can I still add those?
With such a cool, interactive feature as a Yahoo! map on your Flex site, your customers are going to be flocking to your location. To make it even easier for your customers, why not display all of the traffic problems in your area? Using overlays, this too can be done with just a few lines of code. Since we don't want our beautiful map defaced with all sorts of traffic and construction icons all the time let's give the user the ability to turn on the traffic overlay. To do this, we will add a Button component to our Flex application and launch the traffic overlay using the click event of the button. Would you believe me if I said this can be done with one line of code? Just add this one line of MXML to your application and your local traffic report is always one click away.

 

  1.      
  2.   
  3. <mx:Button id="trafficButton" label="Traffic Report"      
  4.   
  5.               click="new Overlays(myAS2Map).showTrafficOverlay();"/>     

 

Using inline code, you can instantiate the Overlays class and call the showTrafficOverlay() method, all in one line. Now that I proved it can be done in one line, you'll probably want to add a few more lines of code to make this more functional. A few lines of code will be used to position interface elements properly, and a few more lines will add some logic to the trafficButton. In its default state, you probably want the button to say "Show Traffic Report", and once it's clicked, you'll want it to switch to "Remove Traffic Report", and change its function accordingly. This really doesn't have anything to do with the Yahoo! AS3 Maps Communication Kit itself, but let's take a look at how to do this anyway.

First, let's position things a bit better, so the button doesn't sit on top of the map. To do this, I simply put my YahooMap and Button in a VBox container. I also moved the horizontalCenter and verticalCenter attributes from my YahooMap tag to the VBox container. Setting it up this way ensures that the button will always appear below the map, and both will always appear centered in the browser. Before I show you the code for that, let's think about that button logic. There are a couple ways it could be done. You could create another Flex state, and in that state change the label and inline click event code to remove the traffic overlay. That would be too simple, so let's do it all with ActionScript instead, this will really impress your friends and family (because, really, so far this application has been far too easy to build !)

Instead of having the traffic overlay code inline, we are giong to call a method called toggleTrafficView(). This method will keep the state of the traffic overlay and change the button text and click event to reflect the current state. Here is the code for our entire MXML file (don't forget to check out the new VBox container):

 

  1.      
  2.   
  3. <?xml version="1.0" encoding="utf-8"?>     
  4.   
  5. <mx:Application      
  6.   
  7.     xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:yahoo="com.yahoo.webapis.maps.*"      
  8.   
  9.     layout="absolute" creationComplete="init();" >     
  10.   
  11.    <mx:Script>     
  12.   
  13.       <![CDATA[     
  14.   
  15.          import flash.utils.getTimer;     
  16.   
  17.          import mx.controls.Alert;     
  18.   
  19.          import com.yahoo.webapis.maps.methodgroups.*;     
  20.   
  21.               
  22.   
  23.          private const SWFDOMID:String = "YahooAS3Maps";     
  24.   
  25.          private const UNIQUEID:int = getTimer();     
  26.   
  27.          private const YAHOOAPIKEY:String = "InsertYourAPIKeyHere";     
  28.   
  29.          private const MAPSWF:String = "as2map.swf";     
  30.   
  31.               
  32.   
  33.          private function init():void {     
  34.   
  35.             myAS2Map.addEventListener('onMapLoad', onMapLoaded);     
  36.   
  37.             myAS2Map.addEventListener('onMapError', onMapError);     
  38.   
  39.          }     
  40.   
  41.               
  42.   
  43.          private function onMapLoaded(ev:Object):void {     
  44.   
  45.             var panTools:PanTool = new PanTool(myAS2Map);     
  46.   
  47.             panTools.setPanTool(true);     
  48.   
  49.                  
  50.   
  51.             var widgets:Widgets = new Widgets(myAS2Map);     
  52.   
  53.             widgets.showNavigatorWidget();     
  54.   
  55.             widgets.showSatelliteControlWidget();     
  56.   
  57.          }     
  58.   
  59.               
  60.   
  61.          private function onMapError(errorCode:String, httpStatus:String):void {     
  62.   
  63.             Alert.show(errorCode + '/n' + httpStatus, 'Load Error');     
  64.   
  65.          }     
  66.   
  67.               
  68.   
  69.          private function toggleTrafficView():void {     
  70.   
  71.             var trafficVisible:Boolean = trafficButton.label == 'Show Traffic Report' ? false : true;     
  72.   
  73.             if (trafficVisible) {     
  74.   
  75.                trafficButton.label = 'Show Traffic Report';     
  76.   
  77.                new Overlays(myAS2Map).showTrafficOverlay(false);     
  78.   
  79.             } else {     
  80.   
  81.                trafficButton.label = 'Hide Traffic Report';     
  82.   
  83.                new Overlays(myAS2Map).showTrafficOverlay(true);     
  84.   
  85.             }     
  86.   
  87.          }     
  88.   
  89.       ]]>     
  90.   
  91.    </mx:Script>     
  92.   
  93.    <mx:VBox horizontalAlign="center" horizontalCenter="0" verticalCenter="0">     
  94.   
  95.       <yahoo:YahooMapService id="myAS2Map" UUID="{UNIQUEID}"      
  96.   
  97.           swfDomId="{SWFDOMID}" apiId="{YAHOOAPIKEY}" mapURL="{MAPSWF}" width="600" height="400" />        
  98.   
  99.       <mx:Button id="trafficButton" label="Show Traffic Report" click="toggleTrafficView();"/>     
  100.   
  101.    </mx:VBox>     
  102.   
  103. </mx:Application>   

 

Link to working swf.

And voila, "I was stuck in traffic" is no longer an acceptible excuse.

Yahoo Maps and Yahoo Pipes Mash-up

 

GeoRSS, can I still plot points using an RSS feed?
I am glad you asked, because the answer is - absolutely. For this example, I am going to use data from another Yahoo! property: Pipes. Yahoo! Pipes is an interactive feed aggregator and manipulator. Using Pipes, you can create feeds that are more powerful, useful and relevant and the best part is all of their data is Flash-friendly, with a wide-open crossdomain policy, so Flash developers can have fun too!

In this example, I'll use a pipe (the name for a feed built in Yahoo! Pipes) I found on pipes.yahoo.com. The pipe matches schools found in Yahoo! Search with their location found in Yahoo! Local and generates a geoRSS feed. You can also limit the number of schools per type that are returned. This pipe requires two parameters, a zip code, and a maximum number of schools per type. In our example, we will use one numeric search field, a numeric stepper, and a button. Clicking the button will dynamically create the pipes URL and the returned data will be loaded onto our map which will be positioned based on the zip code. Ok, ok, enough chit-chat, let's see the code:

 

  1.      
  2.   
  3. <?xml version="1.0" encoding="utf-8"?>     
  4.   
  5. <mx:Application      
  6.   
  7.        xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:yahoo="com.yahoo.webapis.maps.*"    
  8.   
  9.        creationComplete="init()" layout="absolute" >     
  10.   
  11.    <mx:Script>     
  12.   
  13.       <![CDATA[     
  14.   
  15.          import flash.utils.getTimer;     
  16.   
  17.          import mx.controls.Alert;     
  18.   
  19.          import flash.utils.setTimeout;     
  20.   
  21.          import com.yahoo.webapis.maps.methodgroups.*;     
  22.   
  23.               
  24.   
  25.          private const SWFDOMID:String = "howtoMapsAS3ExGeorssPipes";     
  26.   
  27.          private const UNIQUEID:int = getTimer();     
  28.   
  29.          private const YAHOOAPIKEY:String = "InsertYourAPIKeyHere";     
  30.   
  31.          private const MAPSWF:String = "as2map.swf";     
  32.   
  33.               
  34.   
  35.          private var overlays:Overlays;     
  36.   
  37.          private var mapController:MapController;     
  38.   
  39.               
  40.   
  41.          private function init():void {     
  42.   
  43.             myAS2Map.addEventListener('onMapLoad', onMapLoaded);     
  44.   
  45.             myAS2Map.addEventListener('onMapError', onMapError);     
  46.   
  47.          }     
  48.   
  49.               
  50.   
  51.          private function onMapLoaded(ev:Object):void {     
  52.   
  53.             var panTools:PanTool = new PanTool(myAS2Map);     
  54.   
  55.             panTools.setPanTool(true);     
  56.   
  57.                  
  58.   
  59.             var widgets:Widgets = new Widgets(myAS2Map);     
  60.   
  61.             widgets.showNavigatorWidget();     
  62.   
  63.             widgets.showSatelliteControlWidget();     
  64.   
  65.                  
  66.   
  67.             overlays = new Overlays(myAS2Map);     
  68.   
  69.             mapController = new MapController(myAS2Map);     
  70.   
  71.          }     
  72.   
  73.               
  74.   
  75.          private function onMapError(errorCode:String, httpStatus:String):void {     
  76.   
  77.             Alert.show(errorCode + '/n' + httpStatus, 'Load Error');     
  78.   
  79.          }     
  80.   
  81.               
  82.   
  83.          public function getHouse():void {     
  84.   
  85.             var pipeURL:String = "http://pipes.yahoo.com/pipes/hPD_lmy_2xGykI16dbq02Q/run?   
  86.  
  87.                                  numberinput1="+prox.value.toString()+"&locationinput1="    
  88.   
  89.                                  +locationQuery.text+"&_render=rss";     
  90.   
  91.             overlays.removeGeoRssOverlay();     
  92.   
  93.             overlays.showGeoRssOverlay(pipeURL);     
  94.   
  95.             mapController.setCenterByAddressAndZoom(locationQuery.text, 6);     
  96.   
  97.          }     
  98.   
  99.               
  100.   
  101.       ]]>     
  102.   
  103.    </mx:Script>     
  104.   
  105.         
  106.   
  107.       <mx:HBox horizontalCenter="0" verticalCenter="0" width="884">     
  108.   
  109.             <mx:Panel x="195" y="210" width="251" height="254" layout="absolute"      
  110.   
  111.             title="School by zip locator">     
  112.   
  113.                   <mx:Label text="Max number of results"  x="10" y="109"/>     
  114.   
  115.                   <mx:Label text="per school type"  x="50" y="122"/>     
  116.   
  117.                   <mx:Text x="10" y="12" text="Show me all the schools located in    
  118.  
  119.                   the entered zip code region. Enter the max number of school types you    
  120.  
  121.                   want to see per region (i.e. 5 means you will see a max of 5    
  122.  
  123.                   elementary schools, 5 high schools, etc." width="211"/>     
  124.   
  125.                   <mx:Label text="Zip Code: "  x="86" y="148"/>     
  126.   
  127.                   <mx:TextInput x="149" y="146" width="69" id="locationQuery"      
  128.   
  129.                   text="95120" maxChars="5" restrict="0-9"/>     
  130.   
  131.                   <mx:NumericStepper x="149" y="114" width="69" id="prox"      
  132.   
  133.                   value="2" minimum="1" maximum="10" stepSize="1" enabled="true"/>     
  134.   
  135.                   <mx:Button id="findhouse" x="73" y="176" label="Show me the schools!"      
  136.   
  137.                   click="this.getHouse()" />     
  138.   
  139.             </mx:Panel>     
  140.   
  141.             <mx:Panel  x="464" y="210" width="617" height="440" layout="absolute" id="mapPanel"      
  142.   
  143.             title="Results brought to you by the good people at Yahoo! Maps and Yahoo! Pipes"      
  144.   
  145.             verticalScrollPolicy="off" horizontalScrollPolicy="off">     
  146.   
  147.                   <yahoo:YahooMapService id="myAS2Map" UUID="{UNIQUEID}" swfDomId="{SWFDOMID}"      
  148.   
  149.                   apiId="{YAHOOAPIKEY}" mapURL="{MAPSWF}" width="600" height="400" />           
  150.   
  151.             </mx:Panel>     
  152.   
  153.       </mx:HBox>     
  154.   
  155. </mx:Application>  

 

Link to working swf.

Well that's it for now. I hope it's enough to get you started and inspired. I plan to write another tutorial in the coming weeks showcasing some of the other functionality available in the extensive Yahoo Maps! API. For now feel free to download the Yahoo! AS3 Maps Communication Kit as it contains all of the examples in this article and other examples that use methods that weren't part of this write-up. Lastly, make sure you come back to the Yahoo! Flash Developer Center often, as we are constantly adding and updating our content.

Summary

Check out the finished products to see how easy it was to integrate Yahoo! Maps into an application.

Where to go from here

I hope these code examples give you a great start in developing your own AS3 Yahoo! Maps applications. Make sure to submit your apps and mashups to gallery.yahoo.com/flash and be sure to check back here often for more coverage and examples of the Yahoo! AS3 Maps Communication Kit.

 
YOLOv8作物病害检测实战源码 这是一套基于YOLOv8n的农田病虫害目标检测系统,对叶片照片做目标检测,识别健康叶片、褐斑病、白粉病、锈病四类,并给出对应防治建议。全流程纯CPU可跑,配套交付完整Python源码、9章实战教程(md/html/pdf三种格式)、100张自造样本及YOLO标签、训练曲线与混淆矩阵截图、Tkinter界面和答辩PPT。 系统围绕五项功能展开:同一套推理逻辑覆盖图像、视频、摄像头三种来源;图形界面选文件即检测,画面叠彩色框标注病名与置信度,右侧面板同步给出症状与防治措施;检测记录自动写入CSV,统计页一键生成四类病害占比饼图;训练结束自动产出损失与精度曲线;内置防治建议文案库,检测命中即回填面板。 选型用YOLOv8n nano档,参数量约320万、权重约6.2MB,CPU单帧几十毫秒,小样本训练5到8分钟完成。数据由data_gen.py程序化绘制100张叶片图,固定随机种子,重跑分布一致,不依赖公开数据集。依赖全部锁版本,教程第7章整理了19条真实报错及排查方法,第8章给出换模型档、换PlantVillage数据集的迁移路径。 适合做计算机视觉方向课程设计或毕业设计的学生,也适合智慧农业方向想了解检测模型如何落进业务面板的学习者。不需要GPU,不需要系统学过目标检测,教程第3章会按需补齐原理。 使用时先pip install -r requirements.txt装好依赖,download_data.py下载预训练权重,data_gen.py生成样本后train.py训练,完成后用main.py infer批量检测或main.py gui启动界面。 立即下载

相关推荐

数据挖掘实战:决策树 + 聚类 + 关联规则,零 Key 离线可跑(Python 源码)

数据挖掘实战包。用 Python 标准库实现 CART 风格决策树、K-Means 聚类与 Apriori 关联规则,在虚构「星河便利店」会员表和购物篮上跑通分类、分群与购物篮分析,并给出准确率、轮廓系数、支持度/置信度/提升度。零第三方依赖、零 API Key 即可离线跑通。含 4 个样例、离线冒烟、中文 README(含「使用方法」)。均为作者原创可运行源码。MIT。作者 blog.youkuaiyun.com/mtl1994

Yahoo!Maps 指南

我们之前分别品尝过Yahoo! Maps可口的甜饼、辛辣的烧饼,经过长时间的等待后,最近Yahoo终于发布了其旗下产品的Flash AS3开发类库,该类库包含Answers、Weather、Search、Upcoming.org及Maps等多项产品的开源AS3类库,开始了对As3的全面支持,Yahoo ActionScript 3 API大餐降临人间,今天我们就来和大家说说在Flex 2中怎样使用

半道出家的和尚 2409

科技中介服务机构在技术供需对接中如何实现服务流程的自动化与标准化?.docx

科技中介服务机构在技术供需对接中如何实现服务流程的自动化与标准化?

世界变化快,Yahoo也免费开放地图服务

    这世界变化快,继周三Google公布他的Google Map API之后,Yahoo毫不示弱,今天也发布自己的Yahoo Map API。    来自雅虎的详细报道:Yahoo! MAPS API为各个等级的开发者们免费提供雅虎SmartView Technology的公共接口,使开发者能看到他们在Yahoo! MAP上看见他们自己创建的地理数据。开发者们可以通过在现有的Yahoo! MA...

weixin_33929309的博客 173

产业园区如何高效对接企业技术需求与高校科研成果?.docx

科易网基于AI模型+行业大数据,在技术转移、成果转化、技术经纪、知识产权、产业创新、科技招商等垂直领域的多样化应用场景,推出科技创新领域的AI+工具与数智化解决方案,推动科技创新与产业创新智能化发展。

国央企创新负责人如何快速掌握本地科技资源分布与匹配情况?.docx

科易网基于AI模型+行业大数据,在技术转移、成果转化、技术经纪、知识产权、产业创新、科技招商等垂直领域的多样化应用场景,推出科技创新领域的AI+工具与数智化解决方案,推动科技创新与产业创新智能化发展。

yahoo地图 vs Google地图

今天在网上无意间看到了yahoo地图,说实话有点吃惊。人家google做了好几年的地图了居然还有那个不知天高地厚的家伙敢在这里叫嚣。吃惊之余当然要看看这回yahoo做的地图到底怎样拉,会不会像百度一样东施效颦。点击这里进入。 同时打开早就熟悉了的google地图做了一下对比。 开发模式:google地图是用Ajax开发,yahoo不知道是用什么开发...

weixin_34380781的博客 911

国央企创新负责人如何实现科技成果的精准识别与高效筛选?.docx

科易网基于AI模型+行业大数据,在技术转移、成果转化、技术经纪、知识产权、产业创新、科技招商等垂直领域的多样化应用场景,推出科技创新领域的AI+工具与数智化解决方案,推动科技创新与产业创新智能化发展。

产业园区运营负责人如何利用平台实现企业创新需求的精准分析与服务推送?.docx

科易网基于AI模型+行业大数据,在技术转移、成果转化、技术经纪、知识产权、产业创新、科技招商等垂直领域的多样化应用场景,推出科技创新领域的AI+工具与数智化解决方案,推动科技创新与产业创新智能化发展。

高校技术转移办公室人员如何系统化管理科技成果信息?.docx

科易网基于AI模型+行业大数据,在技术转移、成果转化、技术经纪、知识产权、产业创新、科技招商等垂直领域的多样化应用场景,推出科技创新领域的AI+工具与数智化解决方案,推动科技创新与产业创新智能化发展。

科技中介服务机构如何构建标准化、模块化的智能服务工具?.docx

科易网基于AI模型+行业大数据,在技术转移、成果转化、技术经纪、知识产权、产业创新、科技招商等垂直领域的多样化应用场景,推出科技创新领域的AI+工具与数智化解决方案,推动科技创新与产业创新智能化发展。

高校技术转移办公室人员在推动成果转化落地过程中,如何实现科技成果的高效推介与价值评估?.docx

科易网基于AI模型+行业大数据,在技术转移、成果转化、技术经纪、知识产权、产业创新、科技招商等垂直领域的多样化应用场景,推出科技创新领域的AI+工具与数智化解决方案,推动科技创新与产业创新智能化发展。

fab-pm-optimizer-python-entry-py39-20261021-v1-1-0

fab-pm-optimizer-python-entry-py39-20261021-v1-1-0

科技中介服务机构如何通过数智工具提升技术需求挖掘的精准度?.docx

科易网基于AI模型+行业大数据,在技术转移、成果转化、技术经纪、知识产权、产业创新、科技招商等垂直领域的多样化应用场景,推出科技创新领域的AI+工具与数智化解决方案,推动科技创新与产业创新智能化发展。

PSIM-三相维也纳VIENNA整流器电压电流双闭环+中点电位平衡SVPWM控制仿真

内容概要:本文档详细介绍了一种基于PSIM软件实现的三相维也纳(VIENNA)整流器仿真模型,重点实现了电压电流双闭环控制与中点电位平衡的SVPWM调制策略。该仿真系统通过精确的控制算法有效提升了整流器的功率因数,降低了输入电流谐波含量,并解决了三电平拓扑中常见的直流侧中点电位偏移问题,具有较高的工程实用价值,适用于高效率、高功率密度的电力电子系统设计与科研验证。文档还整合了丰富的配套资源,涵盖多种电力电子变换器拓扑结构、先进控制算法及典型应用场景,形成了系统化的技术资料体系,有助于深入理解现代整流技术的核心原理与发展动态。; 适合人群:面向从事电力电子、电气工程、新能源变换系统等领域的科研人员、高校研究生以及具备一定仿真基础的工程技术人员。; 使用场景及目标:①深入研究三相VIENNA整流器的工作机理与控制特性;②掌握电压外环、电流内环双闭环控制结构的设计方法;③理解并实现SVPWM调制技术与中点电位平衡控制策略的协同作用;④开展相关控制算法的仿真验证、性能优化与实验对比,为高性能整流装置的研发提供理论支撑和技术原型。; 阅读建议:建议结合文中列出的其他仿真案例(如PWM整流器、LLC谐振变换器、DAB变换器等)进行横向对比学习,充分利用所提供的PSIM、MATLAB/Simulink等多平台仿真资源,重点关注控制逻辑与主电路的耦合关系,通过参数调试与波形分析深化对系统动态响应和稳态性能的理解,强化“理论—建模—仿真—优化”的闭环研究能力。

产业园区运营负责人如何利用数智工具提升园区企业的技术对接效率?.docx

科易网基于AI模型+行业大数据,在技术转移、成果转化、技术经纪、知识产权、产业创新、科技招商等垂直领域的多样化应用场景,推出科技创新领域的AI+工具与数智化解决方案,推动科技创新与产业创新智能化发展。

政府科技管理者如何在政策支持中更精准地识别和支持高价值科技项目?.docx

科易网基于AI模型+行业大数据,在技术转移、成果转化、技术经纪、知识产权、产业创新、科技招商等垂直领域的多样化应用场景,推出科技创新领域的AI+工具与数智化解决方案,推动科技创新与产业创新智能化发展。

ICD10 openGauss版

ICD10 openGauss版

上一篇: See what in Yahoo pipe
下一篇: 使用 Yahoo! Maps Flash API
GunGunSeeBlood
博客等级 码龄19年 2粉丝 17原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值