谷歌地图custum信息框 [英] google maps custum info box
本文介绍了谷歌地图custum信息框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我喜欢我要制作信息图片的图片
//图片
http://i.hizliresim.com/aqB15Q.png
I like the picture I want to make my info box
//Picture
http://i.hizliresim.com/aqB15Q.png
GMap1.addGMapUI(new GMapUI());
GMap1.GZoom = 2;
GMap2.addGMapUI(new GMapUI());
GMap2.GZoom = 2;
List<GMarker> markers = new List<GMarker>();
double[] aaa1 = new double[3];
double[] aaa2 = new double[3];
string[] stdize = new string[3];
aaa1[0] = 39.5;
aaa2[0] = -3.4;
aaa1[1] = 39.1;
aaa2[1] = -3.1;
aaa1[2] = 38.8;
aaa2[2] = -2.8;
stdize[0] = "<center><div class=\"box\">bilgi kutum!</div></center>";
stdize[1] = "<div class=\"box\">bilgi kutum!</div>";
string url="http://www.google.com.tr";
stdize[2] = "<a href="+url+">deneme</a>";
string html_text = "<center><div class=\"csstest\"><table><tr><td>Title 1</td></tr><tr><td>Row 1</td></tr>" +
"<tr><td>Row 2</td></tr><tr><td>Row 2</td></tr><tr><td>Row 3</td></tr></table></div></center>";
Random r = new Random();
GIcon icon = new GIcon();
GMarker mkr;
icon.image = "http://i.hizliresim.com/9Xvp95.png";
icon.shadow = "http://i.hizliresim.com/krZY1D.png";
icon.iconSize = new GSize(32, 32);
icon.shadowSize = new GSize(56, 32);
icon.iconAnchor = new GPoint(16, 32);
icon.infoWindowAnchor = new GPoint(16, 0);
for (int i = 0; i < 3; i++)
{
GMarker gMarker = new GMarker(new GLatLng(aaa1[i], aaa2[i]),icon);
markers.Add(gMarker);
//{0}
//string fakir = @"function () {{ var w = new google.maps.InfoWindow(); w.setContent('" + stdize[i] + "'); w.open({1}, {2});}}";
string fakir = @"function () {{ var w = new google.maps.InfoWindow(); w.setContent('" + html_text + "'); w.open({1}, {2});}}";
// string fakir = @"function () {{ var w = new google.maps.InfoWindow(); w.setContent('" + html_text + "');}}";
GListener listener = new GListener(gMarker.ID, GListener.Event.click, string.Format(fakir, i, GMap1.GMap_Id, gMarker.ID));
GMap1.Add(listener);
}
GMap2.markerClusterer = new MarkerClusterer(markers);
MarkerClustererStyleOptions markerClustererStyleOptions = new MarkerClustererStyleOptions();
markerClustererStyleOptions.textColor = Color.Yellow;
MarkerClustererOptions markerClustererOptions = new MarkerClustererOptions(60, 10);
MarkerClustererStyleOptions styleOptionsA = new MarkerClustererStyleOptions();
styleOptionsA.height = 36;
styleOptionsA.width = 40;
styleOptionsA.anchor_x = 6;
styleOptionsA.anchor_y = 0;
styleOptionsA.textColor = Color.Blue;
styleOptionsA.url = "http://gmaps-utility-library.googlecode.com/svn/trunk/markerclusterer/1.0/images/conv40.png";
MarkerClustererStyleOptions styleOptionsB = new MarkerClustererStyleOptions();
styleOptionsB.height = 35;
styleOptionsB.width = 35;
styleOptionsB.anchor_x = 16;
styleOptionsB.anchor_y = 0;
styleOptionsB.textColor = Color.WhiteSmoke;
styleOptionsB.url = "http://gmaps-utility-library.googlecode.com/svn/trunk/markerclusterer/1.0/images/people35.png";
markerClustererOptions.markerClustererStylesOptions.Add(styleOptionsA);
markerClustererOptions.markerClustererStylesOptions.Add(styleOptionsB);
MarkerClusterer markerClusterer = new MarkerClusterer(markers, markerClustererOptions);
GMap1.markerClusterer = markerClusterer;
推荐答案
这篇关于谷歌地图custum信息框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文