Help us translate this website and improve this translation and earn free licenses!
Anonymous user  |  Log in  |  Create Account

MapIconMaker

The MapIconMaker is part of the GMaps Utility Library.

It lies in creating configurable icons. In order to do that, we can use this properties: 
- markerIconOptions
- labelMarkerIconOptions
- flatIconOptions

Using any of the will overwrite anything we have done to the GIcon before.




Code.aspx
<cc1:GMap ID="GMap1" runat="server" />
Code.aspx.cs
GLatLng latLng = new GLatLng(50, 10);
GMap1.setCenter(latLng, 4);

GIcon icon = new GIcon();
icon.markerIconOptions = new MarkerIconOptions(50, 50, Color.Blue);
GMarker marker = new GMarker(latLng, icon);
GInfoWindow window = new GInfoWindow(marker, "You can use the Map Icon Maker as any other marker");
GMap1.Add(window);

GIcon icon2 = new GIcon();
icon2.labeledMarkerIconOptions = new LabeledMarkerIconOptions(Color.Gold, Color.White, "A", Color.Green);
GMarker marker2 = new GMarker(latLng + new GLatLng(3, 3), icon2);
GInfoWindow window2 = new GInfoWindow(marker2, "You can use the Map Icon Maker as any other marker");
GMap1.Add(window2);

GIcon icon3 = new GIcon();
icon3.flatIconOptions = new FlatIconOptions(25, 25, Color.Red, Color.Black, "B", Color.White, 15,
                                            FlatIconOptions.flatIconShapeEnum.roundedrect);
GMarker marker3 = new GMarker(latLng + new GLatLng(-3, -3), icon3);
GInfoWindow window3 = new GInfoWindow(marker3, "You can use the Map Icon Maker as any other marker");
GMap1.Add(window3);
Powered by Subgurim.NET