在Esri-React-Boot上修改Basemap没有Map显示



我被卡住了,不知道我做错了什么。我目前正在尝试从Esri (https://github.com/Esri/esri-react-boot)修改这个库。

它使用OAuth,但你可以查看地图而不必登录。但是,如果我想修改basemap配置以显示arcgis-topographic,就像这里的教程(https://developers.arcgis.com/javascript/latest/display-a-map/)一样,我没有得到任何地图的渲染。

本教程使用API Key,但当使用OAuth时,您不需要做任何类似的事情。

下面是我只修改过的2个文件,其他的都和在repo中一样。

json

{
"appVersion": "2.0.0",
"apiUrl": "api",
"loginUrl": "api/auth/arcgis",
"logoutUrl": "api/logout",
"jsapiUrl": "https://js.arcgis.com/4.17/",
"jsapiV4": true,
"clientId": "<hidden>",
"sessionId": "esri-react-boot_session",
"mapConfig": {
"basemap": "arcgis-topographic",
"center": [-118.805, 34.027],
"zoom": 13
}
}

package.json

{
"name": "react-jsapi-app",
"version": "0.1.0",
"private": true,
"homepage": "/",
"dependencies": {
"@esri/arcgis-rest-auth": "^3.0.0",
"@esri/arcgis-rest-portal": "^3.0.0",
"@esri/arcgis-rest-request": "^3.0.0",
"calcite-react": "^0.44.0",
"esri-loader": "^2.16.0",
"framer-motion": "^1.6.18",
"js-cookie": "^2.2.1",
"react": "^16.12.0",
"react-dom": "^16.12.0",
"react-redux": "^7.1.3",
"react-router-dom": "^5.1.2",
"react-transition-group": "^4.3.0",
"redux": "^4.0.4",
"redux-saga": "^1.1.3",
"styled-components": "^4.4.1"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
},
"devDependencies": {
"react-scripts": "^3.3.0"
},
"browserslist": {
"development": [
"last 2 chrome versions",
"last 2 firefox versions",
"last 2 edge versions"
],
"production": [
">1%",
"last 4 versions",
"Firefox ESR",
"not ie < 11"
]
}
}

提前谢谢你。

https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap

这显示了基图的可用性,这取决于是否使用API Key。

最新更新