zoukankan      html  css  js  c++  java
  • Arcgis silverlight6 element layermeida

    1、功能介绍
        This sample demonstrates how to transform and display a media element (video) on a map.  The video placed initially using the ElementLayer.Envelope attached property.  A simple rotation transformation is then used to orient the video to an acceptable location over the base map.  More accurate placement will require a more complex transformation.     

        展示一个media element (video) on a map

     

    2、代码详解

    MainPage.axml中

    代码
    <UserControl x:Class="SilverlightApplication1.MainPage"
        xmlns
    ="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x
    ="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d
    ="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc
    ="http://schemas.openxmlformats.org/markup-compatibility/2006"
        mc:Ignorable
    ="d"
        d:DesignHeight
    ="300" d:DesignWidth="400" xmlns:esri="http://schemas.esri.com/arcgis/client/2009">

        
    <Grid x:Name="LayoutRoot" Background="White">

            
    <esri:Map x:Name="MyMap" Extent="-121,32,-113,36">
                
    <esri:ArcGISTiledMapServiceLayer ID="StreetMapLayer" 
                        Url
    ="http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer"/>

                
    <esri:ElementLayer ID="MyMediaLayer" > //ID=MyMediaLayer
                    
    <esri:ElementLayer.Children>
                        
    <!-- MediaElement source can define relative path from the perspective of the xap file. -->
                        
    <MediaElement xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
                                    Source
    ="http://serverapps.esri.com/media/scec-shakeout-simulation-rt.wmv//Media地址
                                    IsMuted
    ="True" Stretch="Fill" MediaEnded="Media_MediaEnded//无声,stretch模式,media终止时触发的函数
                                    esri:ElementLayer.Envelope
    ="-120.309183241879,32.3360853442552,-114.543827787924,35.579097787105">//meida的位置
                            
    <MediaElement.RenderTransform> //meida倾斜一个角度播放
                                
    <RotateTransform Angle="-1.1412502857301" />
                            
    </MediaElement.RenderTransform>
                        
    </MediaElement>
                    
    </esri:ElementLayer.Children>
                
    </esri:ElementLayer>
            
    </esri:Map>

        
    </Grid>
    </UserControl>

     

    MainPage.axml.cs中 

     

    代码
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Net;
    using System.Windows;
    using System.Windows.Controls;
    using System.Windows.Documents;
    using System.Windows.Input;
    using System.Windows.Media;
    using System.Windows.Media.Animation;
    using System.Windows.Shapes;

    namespace SilverlightApplication1
    {
        
    public partial class MainPage : UserControl
        {
            
    public MainPage()
            {
                InitializeComponent();
            }

            
    private void Media_MediaEnded(object sender, RoutedEventArgs args)
            {
                
    // Repeat play of the video
                MediaElement media = sender as MediaElement;
                media.Position 
    = TimeSpan.FromSeconds(0);//从第一秒开始重放
                media.Play();
            }
        }
    }

     

    3、界面见http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#MediaLayer

  • 相关阅读:
    关于分布式事务、两阶段提交协议、三阶提交协议(转)
    高并发下产生大量,随机,唯一的字符串,并输出到文件中
    地理空间距离计算优化_附近的人(转自美团技术博客)
    Web Deploy发布网站错误 检查授权和委派设置
    mssql查询所有上下级
    mssql语句递归查找所有下级
    挖洞技巧:任意账号密码重置
    MAC卸载java 12.0.2
    mac  安装brew时报错的问题及解决方式
    致远getshell
  • 原文地址:https://www.cnblogs.com/king1302217/p/1751285.html
Copyright © 2011-2022 走看看