首先,根據我的知識,Cartotype提供用於在Android,iOS和其他平臺中提供Map的API。insertMapObject函數Android返回23代碼Cartotype
從文檔我發現,符合我的需要的功能
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。
MY需要的是DRAW的線B \ W 2個座標
任何幫助將理解