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

  • 相关阅读:
    CODING x 百果园 _ 水果零售龙头迈出 DevOps 体系建设第一步
    Nocalhost 亮相 CD Foundation 国内首届 Meetup,Keith Chan 将出席致辞
    做云原生时代标准化工具,实现高效云上研发工作流
    打造数字化软件工厂 —— 一站式 DevOps 平台全景解读
    WePack —— 助力企业渐进式 DevOps 转型
    CODING Compass —— 打造行云流水般的软件工厂
    Nocalhost —— 让云原生开发回归原始而又简单
    CODING 代码资产安全系列之 —— 构建全链路安全能力,守护代码资产安全
    Nocalhost:云原生开发新体验
    使用 Nocalhost 开发 Kubernetes 中的 APISIX Ingress Controller
  • 原文地址:https://www.cnblogs.com/king1302217/p/1751285.html
Copyright © 2011-2022 走看看