Google maps api 3 将反应式地图与Google Maps Javascript Api一起使用时出错
我正在尝试使用Elasticsearch中的一些索引文件构建和应用ReactiveSearch和ReactiveMaps Elasticsearch中的索引文件有一个字段“位置”,例如:Google maps api 3 将反应式地图与Google Maps Javascript Api一起使用时出错,google-maps-api-3,reactivesearch,Google Maps Api 3,Reactivesearch,我正在尝试使用Elasticsearch中的一些索引文件构建和应用ReactiveSearch和ReactiveMaps Elasticsearch中的索引文件有一个字段“位置”,例如: "location": { "Lat": 56.746423, "Lon": 37.189268 } 以及“标题”或“作者”等其他字段 我有一个Google maps API密钥,在我的App.js文件中有以下组件: <DataSe
"location": {
"Lat": 56.746423,
"Lon": 37.189268
}
以及“标题”或“作者”等其他字段
我有一个Google maps API密钥,在我的App.js文件中有以下组件:
<DataSearch
componentId="mainSearch"
dataField={["Title", "Title.search", "Abstract", "Abstract.search"]}
queryFormat="and"
placeholder="Search for HEP"
autosuggest={true}
className="datasearch"
innerClass={{
input: "searchbox",
list: "suggestionlist"
}}
/>
<ReactiveMap
componentId="map"
dataField="location"
size={100}
defaultZoom={13}
defaultCenter={{ lat: 37.74, lng: -122.45 }}
showMapStyles={true}
defaultMapStyle="Standard"
showMarkerClusters={true}
showSearchAsMove={true}
searchAsMove={true}
react={{
and: "mainSearch"
}}
onData={result => ({
label: result.Title
})}
/>
({
标签:结果。标题
})}
/>
在同一个文件(“App.js”)中,我有以下几行:
<ReactiveBase
app="title"
url=here_the_elasticsearch_cluster
mapKey="here_my_googlemapsAPI_key"
>
在Public/index.html文件中,我也有
<script
type="text/javascript"
src="https://maps.google.com/maps/api/js?v=3.34&key=MY_GOOGLE_MAPS_API_KEY&libraries=places"
></script>
然而,当我在主工具栏中搜索任何文档时,我找到了它,但是当我单击它时,它不会出现在地图中
我做错了什么?终于解决了。
ReactiveMaps不允许位置字段使用大写,因此我不得不在elasticsearch中更改索引文档,并考虑到这一点
"location": {
"lat": 56.746423,
"lon": 37.189268
}
您是否用自己的密钥替换了谷歌地图的密钥?