本文整理汇总了C#中Marker.setMarkerColor方法的典型用法代码示例。如果您正苦于以下问题:C# Marker.setMarkerColor方法的具体用法?C# Marker.setMarkerColor怎么用?C# Marker.setMarkerColor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Marker
的用法示例。
在下文中一共展示了Marker.setMarkerColor方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
static void Main()
{
MapFigApplication api = new MapFigApplication("https://studio.mapfig.com", "Za40iR62wtzc8HWs4TgJhNSI8_wRcqMa");
Map map = null;
try
{
map = api.get(430); // First of all get the map by ID
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
if (map != null) // if map Found
{
// TODO with map - Update Map object here
/* Update the Map 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(true); // Default false
map.setOverlayEnable(true); // Default false
map.setOverlayTitle("Updated Overlay Title"); // Default NONE
map.setOverlayContent("Updated Overlay Content"); // Default NONE
map.setOverlayBlurb("Example Blurb"); // 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(true); // Default false
map.setShowMeasure(true); // Default false
map.setShowMinimap(true); // Default false
map.setShowSearch(true); // 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
// map.dropAllShapes(); it'll remove all the shapes from Map
// You can add more Markers
Marker marker = new Marker(48.856614, 2.3522219000000177); // One Way - provide Latitude/Longitude directly
/* Properties */
marker.setLocation("New York");
marker.setDescription("<p>This is where you can write the <strong>HTML</strong> code too</p>");
/* Advance Properties */
marker.setShowGetDirection(false);
marker.setShowInfoBox(true);
marker.setShowLocationOnPopup(true);
marker.setHideLabel(true);
/* Styling */
marker.setMarkerStyle(""); // Default NONE, available options are (user,cog,leaf,home,.....)
// Complete list can be found here http://fortawesome.github.io/Font-Awesome/icons/
marker.setMarkerColor(""); // Default NONE, available options are
// (Red,Blue,Green,Purple,Orange,Darkred,Lightred,Beige,Darkblue,Darkpurple,White,
// Pink,Lightblue,Lightgreen,Gray,Black,cadetblue,Brown,Lightgray)
map.addShape(marker);
// Save the map and get the MapID if successfully saved
String response = api.update(map);
// TODO with response
Console.WriteLine(response);
}
}
示例2: Main
//.........这里部分代码省略.........
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);
}
marker1.setDescription("<p>This is where you can write the <strong>HTML</strong> code too</p>");
/* Advance Properties */
marker1.setShowGetDirection(false);
marker1.setShowInfoBox(false);
marker1.setShowLocationOnPopup(true);
marker1.setHideLabel(true);
/* Styling */
marker1.setMarkerStyle(""); // Default NONE, available options are (user,cog,leaf,home,.....)
// Complete list can be found here http://fortawesome.github.io/Font-Awesome/icons/
marker1.setMarkerColor(""); // Default NONE, available options are
// (Red,Blue,Green,Purple,Orange,Darkred,Lightred,Beige,Darkblue,Darkpurple,White,
// Pink,Lightblue,Lightgreen,Gray,Black,cadetblue,Brown,Lightgray)
/* Create Second Marker */
Marker marker2 = new Marker();
try
{
/*
* set the Latitude/Longitude by providing the Address.
* Throws Exception if the Latitude/Longitude is incorrect
*/
marker2.setLatLng("Germany");
}
catch (Exception e)
{
// Handle the Exception Here
Console.WriteLine(e.Message);
}
/* Properties */
//marker2.location = "Germany"; // Here Default location is Set as
// "Paris, France". but you can still change it to your desired.
// Just uncomment the link and Set the Value
marker2.setDescription("<p>This is where you can write the <strong>HTML</strong> code too</p>");
/* Advance Properties */
marker2.setShowGetDirection(false);
marker2.setShowInfoBox(false);
marker2.setShowLocationOnPopup(true);