简体   繁体   English

angular中如何使用ArcGis ESRI地图

[英]How to use ArcGis ESRI maps in angular

Can someone help me how to plot latitude and longitudes on esri maps in angular please?有人可以帮助我如何在 angular 中的 esri 地图上找到 plot 纬度和经度吗?

First thing first, you need to include the ArcGIS library in your angular project.首先,您需要在 angular 项目中包含 ArcGIS 库。 For that you have two options:为此,您有两个选择:

  1. using @arcgis/webpack-plugin , or使用@arcgis/webpack-plugin ,或
  2. using esri-loader使用esri-loader

This that I mentions plus both options are well documented in the ArcGIS documents ArcGIS Docs - Using the ArcGIS API for JavaScript with Angular .我提到的这一点加上这两个选项在 ArcGIS 文档ArcGIS Docs - Using the ArcGIS API for JavaScript with Angular 中都有详细记录

Once you get your project running, you are ready to take the next step.项目运行后,您就可以进行下一步了。

I am still not quite sure how are you retrieving the data.我仍然不太确定你是如何检索数据的。 So the general answer in the API context would be:所以 API 上下文中的一般答案是:

  1. If your data is in GeoJSON format, you can use GeoJSONLayer ( ArcGIS Docs - GeoJSONLayer )如果您的数据是 GeoJSON 格式,您可以使用GeoJSONLayer ( ArcGIS Docs - GeoJSONLayer )
  2. If your data is in CSV format, you can use CSVLayer ( ArcGIS Docs - CSVLayer )如果您的数据是 CSV 格式,您可以使用CSVLayer ( ArcGIS Docs - CSVLayer )
  3. If your data is in KML format you can use KMLLayer ( ArcGIS Docs - KLLayer )如果您的数据是 KML 格式,您可以使用KMLLayer ( ArcGIS Docs - KLLayer )
  4. Finally, the general answer would be to use FeatureLayer and source attribute.最后,一般的答案是使用FeatureLayersource属性。 The process in this case is to retrieve the data create the features (probably using esri/Graphic , esri/geometry/Point and esri/geometry/SpatialReference ), and then add it to the layer using applyEdits method.本例中的过程是检索创建要素的数据(可能使用esri/Graphicesri/geometry/Pointesri/geometry/SpatialReference ),然后使用applyEdits方法将其添加到图层。

One great thing of ArcGIS API (and ESRI's product in general) is that it has great documentation. ArcGIS API(以及 ESRI 的一般产品)的一大优点是它有很好的文档。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM