Select to view content in your preferred language

ESRI Map question

334
3
02-12-2024 07:31 PM
wangshen
New Contributor

I'm new to ESRI maps, and I'm looking to create a map using javascript  where users can click to select points, polygons, or line segments. I'd appreciate guidance on the best method and any example codes you can share.

Thank you

0 Kudos
3 Replies
BernSzukalski
Esri Frequent Contributor

Just something to keep in mind - you can always author the web map using Map Viewer and reference it in your JavaScript code. Saves you a lot of code and time, IMHO.

https://developers.arcgis.com/javascript/latest/sample-code/webmap-basic/

https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html

 

wangshen
New Contributor

Thank you for the reply. 

How to get polygon, points and streets together on the map? Do you need to create a group layers using adding feature layer service?

thanks

Shen

0 Kudos
BernSzukalski
Esri Frequent Contributor

Using Map Viewer point, polygon, and line layers can be added individually. Depending on what you want to do, those layers can remain individual layers or you can add them to a group layer. The choice is yours, and the decision will really be based upon what works best for you. Often the streets are just part of the basemap you choose to use, unless you are doing something specifically with the streets or streets that are different than what appears in basemaps.

0 Kudos