使用缩放级别

时间:2015-04-27 22:25:02

标签: javascript google-maps

我在谷歌地图上创建标签,但我想根据缩放级别更改文本的大小。 这是我尝试过的小提琴。 http://jsfiddle.net/zzhy/frnLkrc9/3/

function createLabel(labelText){

        var myOptions = {
             content: labelText
            ,boxStyle: {
               border: "3px solid black"
              ,textAlign: "center"
              ,fontSize: "18pt"
              ,width: "50px"
             }
            ,disableAutoPan: true
            ,pixelOffset: new google.maps.Size(-25, 0)
            ,position:  new google.maps.LatLng(39.300299, 34.471664)
            ,closeBoxURL: ""
            ,isHidden: false
            ,pane: "mapPane"
            ,enableEventPropagation: true
        };

        var ibLabel = new InfoBox(myOptions);
        ibLabel.open(map);
    }

1 个答案:

答案 0 :(得分:0)

添加事件侦听器以检查zoom_change,然后更新框样式。像这样的东西会起作用:



Response.Clear();
Response.ContentType = "application/zip";
Response.AddHeader("content-disposition", "filename=" + "sample.zip");
using (ZipFile zip = new ZipFile())
{
    zip.AddDirectory(Server.MapPath("~/Directories/hello"));
    zip.Save(Server.MapPath("~/Directories/hello/sample.zip"));
}