我从ThemeForest购买了一个主题,但无法弄清楚如何将地图默认视图更改为Satellite。我查看了各种文件,感觉自己很接近,但到目前为止。该网站似乎正在使用Qode的框架。我从他们那里找不到任何有关如何执行此操作的文档。
我以为它在这里,但是默认情况下使用qodefMapsVars来获取地址,纬度和经度的变量
var defaults = {
location : qodefSingleMapVars.single['currentRealEstate'].location,
zoom : 16,
mapHolder : '',
draggable : qodefMapsVars.global.draggable,
mapTypeControl : qodefMapsVars.global.mapTypeControl,
scrollwheel : qodefMapsVars.global.scrollable,
streetViewControl : qodefMapsVars.global.streetViewControl,
zoomControl : qodefMapsVars.global.zoomControl,
title : qodefSingleMapVars.single['currentRealEstate'].title,
itemId : qodefSingleMapVars.single['currentRealEstate'].itemId,
content : '',
styles: qodefMapsVars.global.mapStyle,
markerPin : qodefSingleMapVars.single['currentRealEstate'].markerPin,
featuredImage : qodefSingleMapVars.single['currentRealEstate'].featuredImage,
itemUrl : qodefSingleMapVars.single['currentRealEstate'].itemUrl
};
这是map-options.php文件的代码:
<?php
if ( ! function_exists('qodef_real_estate_map_options_map') ) {
function qodef_real_estate_map_options_map() {
$panel_maps = eiddo_qodef_add_admin_panel( array(
'title' => 'Maps',
'name' => 'panel_maps',
'page' => '_real_estate'
) );
eiddo_qodef_add_admin_field(
array(
'parent' => $panel_maps,
'type' => 'textarea',
'name' => 'real_estate_map_style',
'default_value' => '',
'label' => esc_html__('Maps Style', 'select-real-estate'),
'description' => esc_html__('Insert map style json', 'select-real-estate'),
)
);
eiddo_qodef_add_admin_field(
array(
'parent' => $panel_maps,
'type' => 'yesno',
'name' => 'real_estate_maps_scrollable',
'default_value' => 'yes',
'label' => esc_html__('Scrollable Maps', 'select-real-estate'),
'description' => '',
)
);
eiddo_qodef_add_admin_field(
array(
'parent' => $panel_maps,
'type' => 'yesno',
'name' => 'real_estate_maps_draggable',
'default_value' => 'yes',
'label' => esc_html__('Draggable Maps', 'select-real-estate'),
'description' => '',
)
);
eiddo_qodef_add_admin_field(
array(
'parent' => $panel_maps,
'type' => 'yesno',
'name' => 'real_estate_maps_street_view_control',
'default_value' => 'yes',
'label' => esc_html__('Maps Street View Controls', 'select-real-estate'),
'description' => '',
)
);
eiddo_qodef_add_admin_field(
array(
'parent' => $panel_maps,
'type' => 'yesno',
'name' => 'real_estate_maps_zoom_control',
'default_value' => 'yes',
'label' => esc_html__('Maps Zoom Control', 'select-real-estate'),
'description' => '',
)
);
eiddo_qodef_add_admin_field(
array(
'parent' => $panel_maps,
'type' => 'yesno',
'name' => 'real_estate_maps_type_control',
'default_value' => 'yes',
'label' => esc_html__('Maps Type Control', 'select-real-estate'),
'description' => '',
)
);
}
add_action('eiddo_qodef_additional_real_estate_options_map', 'qodef_real_estate_map_options_map',
13);
}
感谢您的帮助。