我正在使用ArcGIS JSAPI 4.12,并希望使用空间幻觉在地图上绘制军事符号。
当我添加milsymbol.js到脚本时,控制台返回错误Uncaught SyntaxError: Cannot use import statement outside a module,因此我添加type="module"到脚本时,它返回Uncaught ReferenceError: ms is not defined。
这是我的代码:
<link rel="stylesheet" href="https://js.arcgis.com/4.12/esri/css/main.css">
<script src="https://js.arcgis.com/4.12/"></script>
<script type="module" src="milsymbol-2.0.0/src/milsymbol.js"></script>
<script>
require([
"esri/Map",
"esri/views/MapView",
"esri/layers/MapImageLayer",
"esri/layers/FeatureLayer"
], function (Map, MapView, MapImageLayer, FeatureLayer) {
var symbol = new ms.Symbol("SFG-UCI----D", { size: 30 }).asCanvas(3);
var map = new Map({
basemap: "topo-vector"
});
var view = new MapView({
container: "viewDiv",
map: map,
center: [121, 23],
zoom: 7 …Run Code Online (Sandbox Code Playgroud) 我在将 DataFrame 随机分成df较小的DataFrames.
df
movie_id 1 2 4 5 6 7 8 9 10 11 12 borda
0 1 5 4 0 4 4 0 0 0 4 0 0 21
1 2 3 0 0 3 0 0 0 0 0 0 0 6
2 3 4 0 0 0 0 0 0 0 0 0 0 4
3 4 3 0 0 0 0 5 0 0 4 0 5 17
4 5 3 …Run Code Online (Sandbox Code Playgroud) 我正在研究TextView包含在 a 中的 a ConstraintLayout。
如果长度超过 maxLength,我希望 ellipsize 在文本末尾(在 TextView 中)添加三个点。
在对我的问题进行彻底研究后, maxLines="1" 和 ellipsize="end" 似乎是最好的答案。不幸的是,它对我的情况不起作用。三个点根本没有显示。
这是快照:

原始字符串是“测试长描述”(n 被删除)。它应该显示“测试长描述......”。
这是我的 xml :
<TextView
android:id="@+id/txtDescription"
android:maxLength="24"
android:maxLines="1"
android:ellipsize="end"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="120dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="8dp"
android:text="DescriptionView"
android:textSize="18sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.72" />
Run Code Online (Sandbox Code Playgroud)
我觉得 XML 中有一些覆盖 ellipsize 的东西,还是我错过了 XML 文件中的一些重要内容?
在我将项目的副本放在同一文件夹下后,我的 Android 项目文件就变得一团糟。作为具有 xml 内容和其他格式的 java 文件,我不知道,xml 文件和 gradle 文件也是如此。这些文件只是混在一起,随机弄乱了。cannot load settings from file曾经显示为警告,所以我删除了它指示的两个文件。不确定它是否导致了这个问题。我该如何修复项目?
这是我的 MainActivity.java
<component name="libraryTable">
<library name="Gradle: com.android.support.test.espresso:espresso-idling-resource:3.0.2@aar">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/7925882b975de0e9c05ac44b0a44095f/jars/classes.jar!/" />
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/7925882b975de0e9c05ac44b0a44095f/res" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.android.support.test.espresso/espresso-idling-resource/3.0.2/6071e2b310c16836ba475a94df377e2f75928546/espresso-idling-resource-3.0.2-sources.jar!/" />
</SOURCES>
</library>
</component>
Run Code Online (Sandbox Code Playgroud) android ×2
arcgis ×1
dataframe ×1
ecmascript-6 ×1
java ×1
javascript ×1
jupyter ×1
pandas ×1
python ×1
python-3.x ×1
textview ×1
xml ×1