当前位置: 首页>>代码示例>>C#>>正文


C# MapView.PostInvalidate方法代码示例

本文整理汇总了C#中MapView.PostInvalidate方法的典型用法代码示例。如果您正苦于以下问题:C# MapView.PostInvalidate方法的具体用法?C# MapView.PostInvalidate怎么用?C# MapView.PostInvalidate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MapView的用法示例。


在下文中一共展示了MapView.PostInvalidate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnCreate

        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            /*
             * For Information on how to add you own keystore to the project read the README from the
             * old GoogleMaps sample: https://github.com/xamarin/monodroid-samples/tree/master/GoogleMaps
             * 
             * */

            // Remember to generate your own API key
            mapView = new MapView(this, "0Nd7w_yOI1NbUsBP_Mg2IosWa0Ns2j22r4meJnA");
            mapView.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FillParent, ViewGroup.LayoutParams.FillParent);

            SetContentView(mapView);

            mapView.SetBuiltInZoomControls(true);
            mapView.Enabled = true;
            mapView.Clickable = true; //This has to be set to true to be able to navigate the map

            myLocationOverlay = new MyLocationOverlay(this, mapView); //this shows your current position on the map
            mapView.Overlays.Add(myLocationOverlay);

            Drawable marker = Resources.GetDrawable(Resource.Drawable.Icon); //these are the markers put on the map
            myItemizedOverlay = new MyItemizedOverlay(this, marker);
            mapView.Overlays.Add(myItemizedOverlay);

            myItemizedOverlay.AddItem(new GeoPoint((int)(55.816149 * 1E6),(int)(12.532868 * 1E6)), "BKSV", "Brüel & Kjær Sound & Vision");
            mapView.PostInvalidate();
        }
开发者ID:Cheesebaron,项目名称:MonoDroid.GoogleMapsDemo,代码行数:30,代码来源:MapActivity.cs

示例2: OnCreate

        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            //Read more about obtaining a Maps Key here: http://docs.xamarin.com/android/advanced_topics/Obtaining_a_Google_Maps_API_Key
            mapView = new MapView(this, "<your key here>");
            mapView.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FillParent, ViewGroup.LayoutParams.FillParent);
            mapView.Satellite = true;

            SetContentView(mapView);

            Drawable marker = Resources.GetDrawable(Resource.Drawable.Icon); //these are the markers put on the map
            myItemizedOverlay = new MyItemizedOverlay(this, marker);
            mapView.Overlays.Add(myItemizedOverlay);
            mapView.PostInvalidate();

            GeoPoint point = new GeoPoint((int)(55.785213 * 1E6), (int)(12.522182 * 1E6)); //DTU
            myItemizedOverlay.AddOverlayItem(new OverlayItem(point, "DTU", "Anker Engelunds Vej 101"));

            point = new GeoPoint((int)(55.816034 * 1E6), (int)(12.532547 * 1E6));
            myItemizedOverlay.AddOverlayItem(new OverlayItem(point, "Brüel & Kjær", "Skodsborgvej 307C"));
        }
开发者ID:Cheesebaron,项目名称:MonoDroid.SimpleOverlayItem,代码行数:22,代码来源:Activity1.cs


注:本文中的MapView.PostInvalidate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。