English 中文(简体)
显示“这一规模没有地图数据”,而不是在改变地图类型时改变动物群。
原标题:Display "no map data for this scale" instead of changing zoom when switching map type

在阿戈格尔图中,Im通过打电话制作我自己的定制地图类型。

map.mapTypes.set( my map , new google.maps.ImageMapType({
    getTileUrl: ...
    minZoom: 12,
    maxZoom: 20,
    ...
}));

当然,这些层的动物群范围有限(就这个例子而言是12-20个)。 现在的问题是 go图的违约行为。 如我看表7中的地图,转而去我的地图,地图自动流出到zoom 12/strong>。

相反,当我身处7号冲锋枪,改用我的地图,。 我想看到“这一尺度没有地图数据,请在中显示。

  • Is there some standard option / way how to do this within API v3?
  • Is there some commonly used solution to this problem?
  • If not, what would be the easiest way to do it?

提前感谢。

最佳回答

避免minZoommaxZoom 备选办法并尝试类似办法:

map.mapTypes.set( my map , new google.maps.ImageMapType({
    getTileUrl: function( position, zoom ){
        if( zoom >= 12 && zoom <= 20 ){
            return "http://example.com/tileservice?x="+position.x+"&y="+position.y+"&zoom="+zoom;
        }else{
            return "http://example.com/no_map_data_in_this_scale_please_zoom_in.png";
        }
    },
    ...
}));
问题回答

暂无回答




相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.