gpt4 book ai didi

android - insertMapObject 函数 Android 返回 23 代码 Cartotype

转载 作者:搜寻专家 更新时间:2023-11-01 08:27:57 25 4
gpt4 key购买 nike

首先,据我所知,Cartotype提供了在Android、iOS等平台提供 map 的API。

从文档中我找到了满足我需要的函数

native int com.cartotype.Framework.insertMapObject  (   int     aMapHandle,
int aMapObjectType,
String aLayerName,
Geometry aGeometry,
String aStringAttributes,
int aIntAttribute,
long aId,
boolean aReplace
)

但是他们引用的参数我无法成功获取,最后得到了

// Second or continuing measurement, add to arrays
// and draw line
iDistanceMeasurementX = extendArray(
iDistanceMeasurementX, thisPoint[0]);
iDistanceMeasurementY = extendArray(
iDistanceMeasurementY, thisPoint[1]);

// _thread.iFramework.deleteMapObjects(0,
// ID_MEASUREMENT_TOOL, ID_MEASUREMENT_TOOL, null);
// _thread.iFramework.addLineOrPolygonObject(
// "measurementtool", iDistanceMeasurementX,
// iDistanceMeasurementY,
// Framework.DEGREE_COORDS, null, 0,
// ID_MEASUREMENT_TOOL, false);


//Drawing line geometry
Geometry geometry = new Geometry(Framework.DEGREE_COORDS);
geometry.appendPoint(thisPoint[0],thisPoint[1]);
geometry.beginContour();

try {
int abc = _thread.iFramework.insertMapObject(0, MapObject.LINE_TYPE, "measurementtool", geometry, null, 0,
ID_MEASUREMENT_TOOL, false);
Toast.makeText(getContext(),abc,Toast.LENGTH_SHORT).show();
} catch (Exception e) {
e.printStackTrace();
}

//Drawing line with coordinates
// _thread.iFramework.insertPointMapObject(0,"measurementtool", iDistanceMeasurementX[0],iDistanceMeasurementY[0] ,MapObject.LINE_TYPE, "", 0,
// ID_MEASUREMENT_TOOL, false);
//Toast.makeText(getContext(),"Draw Line ",Toast.LENGTH_SHORT).show();
getMapAndDraw(); // Inefficient, we are drawing

如果根据文档成功,那些“abc”int 返回值 23 并且需要为 0。

我需要画一条 b\w 2 坐标的线

任何帮助将不胜感激

最佳答案

谢谢@Graham

geometry = new Geometry(Framework.DEGREE_COORDS);

iDistanceMeasurementX = extendArray(
iDistanceMeasurementX, thisPoint[0]);
iDistanceMeasurementY = extendArray(
iDistanceMeasurementY, thisPoint[1]);
geometry.appendPoint(iDistanceMeasurementX[iDistanceMeasurementX.length-1], iDistanceMeasurementY[iDistanceMeasurementY.length-1]);

//Drawing line geometry

_thread.iFramework.insertMapObject(0, MapObject.LINE_TYPE, "measurementtool", geometry, null, 0,
0, false);

关于android - insertMapObject 函数 Android 返回 23 代码 Cartotype,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43070174/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com