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


C# Marker.setLatLng方法代码示例

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


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

示例1: Main

        static void Main()
        {
            MapFigApplication api = new MapFigApplication("https://studio.mapfig.com", "Za40iR62wtzc8HWs4TgJhNSI8_wRcqMa");


            String mapName = "My Map";
            int mapHeight = 450;
            int mapWidth = 950;
            int mapZoom = 4;
            Point mapCenter = new Point(48.856614, 2.3522219); // Latitude, Longitude
            /*
                * -- Alternative Way --
                * Point p = new Point();
                *	try {
                *		 *
                *		 * get the Latitude/Longitude in array by providing the Address.
                *		 * Throws Exception if the Address is incorrect
                *		 *
                *		mapCenter = p.setLatLng("United States of America"); // Sets the Point(Lat,Lng)
                *	} catch (Exception e) {
                *		// Handle the Exception Here
                *		echo e.Message;
                *	}
                */
            Map map = new Map(mapName, mapHeight, mapWidth, mapZoom, mapCenter);

            /* These are not required unless you want to change something. 
                * the Default value is set weather or not you write them here.
                */
            map.setLayerId(1);  // Default 1 or change it to the account owner's layer ID
            map.setGroupId(0);  // Default 0 or change it to the account owner's layer group ID
            map.setPassword("");  // Default NONE or change it to the Desire Password to protact the Map
            map.setUseCluster(false);  // Default false
            map.setOverlayEnable(false);  // Default false
            map.setOverlayTitle("");  // Default NONE
            map.setOverlayContent("");  // Default NONE
            map.setOverlayBlurb("");  // Default NONE
            map.setLegendEnable(false);  // Default false
            map.setLegendContent("HTML content here");  // Default NONE
            map.setProjectId(0);	// Default 0 or change it to the account owner's project ID
            map.setShowSidebar(true);  // Default true
            map.setShowExport(false);  // Default false
            map.setShowMeasure(false);  // Default false
            map.setShowMinimap(false);  // Default false
            map.setShowSearch(false);  // Default false
            map.setShowFilelayer(false);  // Default false // shows local file upload button
            map.setShowSvg(false);  // Default false
            map.setShowStaticSidebar(false);  // Default false
            map.setStaticSidebarContent("");  // Default NONE
            /* End Map options */


            /* Add Image Overlay */
            String name = "Overlay Title goes here"; // will not be displayed

            Point upperRightCornor = new Point(0.0, 0.0); // Upper Right Cornor Of Overlay Image
            try
            {
                upperRightCornor.setLatLng("Canada");
            }
            catch (Exception e2)
            {
                // TODO Auto-generated catch block
            }

            Point bottomLeftCornor = new Point(0.0, 0.0); // Bottom Left Cornor Of image
            try
            {
                bottomLeftCornor.setLatLng("United State Of America");
            }
            catch (Exception e2)
            {
                // TODO Auto-generated catch block
            }

            String imageUrl = "http://www.YOUR_IMAGE_URL.com/PATH.JPG";
            String popupContent = "<h3>Image Overlay Content here<h3>";

            ImageOverlay imageOverlay1 = new ImageOverlay(name, upperRightCornor, bottomLeftCornor, imageUrl, popupContent); // Create the overlay

            map.addImageOverlay(imageOverlay1); // Add as many overlays as you want

            //map.dropAllImageOverlays(); // If you want to delete all image overlays
            /* End Map options */





            /* Create First Marker */
            Marker marker1 = new Marker(48.856614, 2.3522219000000177); // One Way - provide Latitude/Longitude directly
            /* Properties */
            try
            {
                marker1.setLocation("Paris, France");
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
//.........这里部分代码省略.........
开发者ID:MapFig,项目名称:mapfig-C-Sharp-SDK-Version-2.0.1,代码行数:101,代码来源:Save.cs


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