Google Maps API v3不使用多边形,突出显示国家边界 [英] Google Maps API v3 Highlight Country Border without using Polygons
问题描述
$ b
var layer = new google。 maps.FusionTablesLayer({query:{select:'geometry',from:'1N2LBk4JHwWpOY4d9fobIn27lfnZ5MDy-NoqqRpk',其中:ISO_2DIGIT IN('CH')},styles:[{polygonOptions:{strokeColor:#FF0000,fillOpacity :0}}]}); layer.setMap(map);
绘制的边框太直
p>
是否有可能使用某种搜索请求,因为如果我访问Google地图并搜索瑞士,则国家边界以浅粉色突出显示。这已经满足了我的要求。请参阅地图
在此先感谢
正如我在评论中所说,至少在我们说话的时候这个API是不可用的。
尽管可以做两件事:
-
订阅此功能请求
希望这有助于您!
I need to highlight the border of a country - let's say Switzerland. I achieved it with already with FusionTablesLayer like:
var layer = new google.maps.FusionTablesLayer({
query: {
select: 'geometry',
from: '1N2LBk4JHwWpOY4d9fobIn27lfnZ5MDy-NoqqRpk',
where: "ISO_2DIGIT IN ('CH')"
},
styles: [
{
polygonOptions: {
strokeColor: "#FF0000",
fillOpacity: "0"
}
}
]
});
layer.setMap(map);
The problem hereby is, that the drawn border is too straight
Is there any possibility to use some kind of search request, because if I go to Google Maps and search for Switzerland the country borders are highlighted in a light pink. This would already fullfil my requirements. See Maps
Thanks in advance
As I said in my comment, this is not available through the API (at least at the time we speak).
You can do 2 things though:
check out this answer where I give a complete solution on how to overlay polygons as country boundaries and provide a complete world data set.
Subscribe to this feature request that is exactly what you are looking for.
Hope this helps!
这篇关于Google Maps API v3不使用多边形,突出显示国家边界的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!