我将 React leaflet 与自定义 CRS、Leaflet CRS 文档一起使用
我想做的是:
ImageOverlay
ImageOverlay
这是我的尝试:
地图容器
<MapContainer
center={[250, 500]}
zoom={0}
style={{ height: '100vh', width: '100%' }}
crs={L.CRS.Simple as CRS}
maxZoom={2}
zoomControl={false}
doubleClickZoom={false}
scrollWheelZoom={false}
dragging={false}
>
<MapClick />
{/**This is where I display the marker */}
{routePoints.map((point, index) => (
<Marker
key={index}
position={point}
icon={L.icon({
iconUrl: `${playerMarkerAssest}`,
iconSize: [35, 35],
})}
/>
))}
{/**This is the image url */}
<ImageOverlay url={mapAssest} bounds={imageBounds} />
</MapContainer>
Run Code Online (Sandbox Code Playgroud)
使用地图事件
useMapEvents({
click: (e) => {
setRoutePoints([...routePoints, e.latlng]); …
Run Code Online (Sandbox Code Playgroud) 我正在图书馆ImportError
使用一段时间。已安装最新版本的 llama-index 库并尝试在 python 3.9 上运行它。GPTSimpleVectorIndex
llama-index
from llama_index import GPTSimpleVectorIndex, SimpleDirectoryReader, LLMPredictor, PromptHelper, ServiceContext
ImportError: cannot import name 'GPTSimpleVectorIndex' from 'llama_index' (E:\Experiments\OpenAI\data anaysis\llama-index-main\venv\lib\site-packages\llama_index\__init__.py
Run Code Online (Sandbox Code Playgroud)
下面给出源代码,
import os, streamlit as st
from llama_index import GPTVectorStoreIndex, SimpleDirectoryReader, LLMPredictor, PromptHelper, ServiceContext
from langchain.llms.openai import OpenAI
Run Code Online (Sandbox Code Playgroud) 我下载了仓库:https ://github.com/menloparklab/falcon-langchain
我virtualenv
为此创建了一个来安装requirments.txt
并运行该应用程序。
使用以下命令运行应用程序后。
chainlit run app.py -w
Run Code Online (Sandbox Code Playgroud)
但我收到错误:
module 'chainlit' has no attribute 'langchain_factory'
Run Code Online (Sandbox Code Playgroud) 在我尝试连接 firebase 之前,我的项目运行良好。然后,我转到tools -> Firebase -> Connect your app to Firebase
并将 Cloud firestore 添加到您的应用程序。在我选择这些选项后,他们说“已连接”和“正确设置依赖项”,但在我收到以下错误后立即:
"Unable to load class 'com.android.build.api.dsl.StoreArchive'."
Run Code Online (Sandbox Code Playgroud)
我没有尝试过任何事情,因为我无法找出错误在哪里。
langchain ×2
android ×1
attributes ×1
gradle ×1
javascript ×1
leaflet ×1
llama-index ×1
python ×1
reactjs ×1