我正在使用最新的gmaps4rails,我想将缩放控件添加到地图中。我已经看过API并尝试设置原始选项,如下所示:
= gmaps({"map_options" => { :raw => "{scrollwheel: false,
disableDefaultUI: false, zoomControl: true, panControl: true,
zoomControlOptions: {style: google.maps.ZoomControlStyle.LARGE }}"},
:markers => {:data => @json}})
但这并没有在地图上显示任何控件。
我需要做些什么来显示地图缩放控件?
答案 0 :(得分:1)
使用:
Gmaps.search_map.map_options.raw.zoomControl = true; // yes, raw
此处有更多选项:https://developers.google.com/maps/documentation/javascript/reference#MapOptions