<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How to create own button for AreaMeasurement2D in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-create-own-button-for-areameasurement2d/m-p/1024416#M71686</link>
    <description>&lt;P&gt;Hi tried to custom my own button to trigger area measurment widget, so it can activate using button that i created, this is my code&lt;/P&gt;&lt;P&gt;&amp;lt;script&amp;gt;&lt;BR /&gt;require([&lt;BR /&gt;"esri/views/MapView",&lt;BR /&gt;"esri/WebMap",&lt;BR /&gt;"esri/widgets/DistanceMeasurement2D",&lt;BR /&gt;"esri/widgets/AreaMeasurement2D",&lt;BR /&gt;"esri/widgets/AreaMeasurement2D/AreaMeasurement2DViewModel",&lt;BR /&gt;], function (&lt;BR /&gt;MapView,&lt;BR /&gt;WebMap,&lt;BR /&gt;DistanceMeasurement2D,&lt;BR /&gt;AreaMeasurement2D,&lt;BR /&gt;AreaMeasurement2DViewModel&lt;BR /&gt;) {&lt;BR /&gt;&lt;BR /&gt;// load a webmap&lt;BR /&gt;const webmap = new WebMap({&lt;BR /&gt;portalItem: {&lt;BR /&gt;id: "990d0191f2574db495c4304a01c3e65b",&lt;BR /&gt;},&lt;BR /&gt;});&lt;/P&gt;&lt;P&gt;// create the map view&lt;BR /&gt;const view = new MapView({&lt;BR /&gt;container: "viewDiv",&lt;BR /&gt;map: webmap,&lt;BR /&gt;});&lt;/P&gt;&lt;P&gt;var measurementWidget = new AreaMeasurement2D({&lt;BR /&gt;view: view,&lt;BR /&gt;});&lt;BR /&gt;view.ui.add(measurementWidget, "top-right");&lt;/P&gt;&lt;P&gt;// Raw measurements (in meters) can be accessed from this property&lt;BR /&gt;measurementWidget.watch("viewModel.measurement", function(measurement) {&lt;BR /&gt;console.log( "Area: ", measurement.area);&lt;BR /&gt;});&lt;BR /&gt;&amp;lt;/script&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;body&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;button type="button" name="button"&amp;gt;do measurment&amp;lt;/button&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/body&amp;gt;&lt;/P&gt;&lt;P&gt;can anyone help me with this? Thank you&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 08 Feb 2021 16:10:25 GMT</pubDate>
    <dc:creator>putra_</dc:creator>
    <dc:date>2021-02-08T16:10:25Z</dc:date>
    <item>
      <title>How to create own button for AreaMeasurement2D</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-create-own-button-for-areameasurement2d/m-p/1024416#M71686</link>
      <description>&lt;P&gt;Hi tried to custom my own button to trigger area measurment widget, so it can activate using button that i created, this is my code&lt;/P&gt;&lt;P&gt;&amp;lt;script&amp;gt;&lt;BR /&gt;require([&lt;BR /&gt;"esri/views/MapView",&lt;BR /&gt;"esri/WebMap",&lt;BR /&gt;"esri/widgets/DistanceMeasurement2D",&lt;BR /&gt;"esri/widgets/AreaMeasurement2D",&lt;BR /&gt;"esri/widgets/AreaMeasurement2D/AreaMeasurement2DViewModel",&lt;BR /&gt;], function (&lt;BR /&gt;MapView,&lt;BR /&gt;WebMap,&lt;BR /&gt;DistanceMeasurement2D,&lt;BR /&gt;AreaMeasurement2D,&lt;BR /&gt;AreaMeasurement2DViewModel&lt;BR /&gt;) {&lt;BR /&gt;&lt;BR /&gt;// load a webmap&lt;BR /&gt;const webmap = new WebMap({&lt;BR /&gt;portalItem: {&lt;BR /&gt;id: "990d0191f2574db495c4304a01c3e65b",&lt;BR /&gt;},&lt;BR /&gt;});&lt;/P&gt;&lt;P&gt;// create the map view&lt;BR /&gt;const view = new MapView({&lt;BR /&gt;container: "viewDiv",&lt;BR /&gt;map: webmap,&lt;BR /&gt;});&lt;/P&gt;&lt;P&gt;var measurementWidget = new AreaMeasurement2D({&lt;BR /&gt;view: view,&lt;BR /&gt;});&lt;BR /&gt;view.ui.add(measurementWidget, "top-right");&lt;/P&gt;&lt;P&gt;// Raw measurements (in meters) can be accessed from this property&lt;BR /&gt;measurementWidget.watch("viewModel.measurement", function(measurement) {&lt;BR /&gt;console.log( "Area: ", measurement.area);&lt;BR /&gt;});&lt;BR /&gt;&amp;lt;/script&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;body&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;button type="button" name="button"&amp;gt;do measurment&amp;lt;/button&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/body&amp;gt;&lt;/P&gt;&lt;P&gt;can anyone help me with this? Thank you&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Feb 2021 16:10:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-create-own-button-for-areameasurement2d/m-p/1024416#M71686</guid>
      <dc:creator>putra_</dc:creator>
      <dc:date>2021-02-08T16:10:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to create own button for AreaMeasurement2D</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-create-own-button-for-areameasurement2d/m-p/1024719#M71698</link>
      <description>&lt;P&gt;I have a codepen that I was starting to play around with changing the buttons of the measure widget.&amp;nbsp; Its pretty crude right now but essentially you customize the button in the css.&amp;nbsp; Take a look, it might give you an idea for your project.&amp;nbsp; &lt;A href="https://codepen.io/static_K/pen/KKNMoMP?editors=1111" target="_self"&gt;customizing measurement buttons&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Feb 2021 01:40:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-create-own-button-for-areameasurement2d/m-p/1024719#M71698</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-02-09T01:40:14Z</dc:date>
    </item>
  </channel>
</rss>

