Google Map Marker图标 [英] Google Map Marker Icon
本文介绍了Google Map Marker图标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好
我找到了一个脚本,该脚本使我能够显示带有标记图标的Google地图.我的问题是我需要根据从数据库接收的信息来显示其他图标.我试图从asp.net后面的代码中调用标记图标,到目前为止,我已经能够运行tom弹出式窗口,但是要更改我没有运气的静态图标.
这两个代码页均在任何帮助下方.
我尝试调用的函数是
Hello
I have found a script that enables me to display a Google map with marker icons. My problem is I need to depending on the information I receive from the database i need to display a different icon. I am trying to call the marker icon from the code behind in asp.net SO far I have been able to get the popup tom work but to change the static icon I have had no luck.
Both code pages are below any help would be appreciated.
Function I am trying to call is
function createMarker(point, html, StartEnd) {
var markerImage
var markerIcon = new GIcon(G_DEFAULT_ICON);
markerIcon.image = markerImage;
markerIcon.iconSize = new GSize(50, 50);
markerIcon.iconAnchor = new GPoint(25, 25);
var marker;
if (StartEnd == "true") {
marker = new GMarker(point, { icon: markerIcon });
}
else {
marker = new GMarker(point);
}
GEvent.addListener(marker, "click", function() {
marker.openInfoWindowHtml(html);
});
return marker;
}
这是aspx.cs文件
this is the aspx.cs file
StringBuilder sbx = new StringBuilder();
sbx.Append("<script language=javascript> createMarker() { var markerIcon = []; ");
sbx.Append("Image markerImage = new Image()");
//markerIcon.
sbx.Append("ImageUrl = ~/Images/AirplaneIcon.gif");
sbx.Append("}</script>");
Page.RegisterStartupScript("createMarker", sbx.ToString());
推荐答案
您看到我的文章了吗?
您将从中获得有关Marker的全部帮助.
轻松使用HTML,ASP.NET,PHP,JSP等格式的Google Maps [
Did you see my article ..
You will get entire help on Marker from it.
Google Maps in HTML, ASP.NET, PHP, JSP etc. with ease[^]
这篇关于Google Map Marker图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文