android - 使用 ArcGis 在 OneMap 上显示位置

标签 android maps arcgis

我是第一次在我的 android 应用程序(java)中使用 ArcGis。

我通过“一张 map ”获得了某个位置的 X 和 Y 坐标http://www.onemap.sg/API/Help/RESTExamples.aspx ,

现在我想在 map 中将此点显示为红点。

X-26005.0765 Y-30007.0973

有人知道要遵循的教程吗?我看到了“Hello Map教程”。

任何人都可以指导我查看带有示例的教程或文档吗?

阿弥陀佛

最佳答案

您必须使用图形层来添加点的图形表示。 下面的代码是您在给定的坐标中打印一个点的示例。

public class Test extends Activity {

// View elements
MapView map;
GraphicsLayer measures = new GraphicsLayer();
Point point;

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);


    // Get elements of the view
    map = (MapView) findViewById(R.id.map);

    map.addLayer(measures);

    Point point = new Point(26005.0765, 30007.0973);

    measures.addGraphic(new Graphic(point,new SimpleMarkerSymbol(Color.RED,10,STYLE.CIRCLE)));

    map.zoomTo(point, 0);
}

}

关于android - 使用 ArcGis 在 OneMap 上显示位置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14271411/

相关文章:

javascript - ESRI JavaScript setRequestPreCallback 部分工作

java - 从扩展的 Application 类停止 Android 服务

android - maxSdk的权限显示为Play商店上每个应用程序更新的新权限

javascript - 创建点、弹出窗口、圆、转换坐标问题(Arcgis JS 4.6 API)

javascript - 如何使用 Google Maps API 获取所选地点的 "latitude and longitude"?

c++ - std::list 与 std::map 属性?

python - python/arcpy SQL 表达式中的循环无效,选择不起作用

android - 在 windows "C compiler cannot create executables"上编译 pjsip

android - 修改Android构建中的BOOTCLASSPATH

javascript - Mapkit JS 无法在手机上移动 map