<?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 Re: Create a point/Polyline on Map with different projection in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/create-a-point-polyline-on-map-with-different/m-p/1293337#M81262</link>
    <description>&lt;P&gt;It looks like you will need to project your geometries before adding them to the map.&amp;nbsp; The preferred way to do this is via &lt;A href="https://developers.arcgis.com/javascript/3/jsapi/esri.geometry.projection-amd.html" target="_self"&gt;the client-side projection engine&lt;/A&gt;&amp;nbsp;like shown below:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
&amp;lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"&amp;gt;
&amp;lt;meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"&amp;gt;
&amp;lt;title&amp;gt;Sapes and Symbols&amp;lt;/title&amp;gt;
&amp;lt;link rel="stylesheet" href="https://js.arcgis.com/3.29/esri/css/esri.css"&amp;gt;
&amp;lt;style&amp;gt;
	#info {
		top: 20px;
		color: #444;
		height: auto;
		font-family: arial;
		right: 20px;
		margin: 5px;
		padding: 10px;
		position: absolute;
		width: 115px;
		z-index: 40;
		border: solid 2px #666;
		border-radius: 4px;
		background-color: #fff;
	}

	html, body, #mapDiv {
		padding: 0;
		margin: 0;
		height: 100%;
	}

	button {
		display: block;
	}
&amp;lt;/style&amp;gt;
&amp;lt;script src="https://js.arcgis.com/3.29/"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script&amp;gt;
	require(["esri/map", "esri/toolbars/draw", "esri/symbols/SimpleMarkerSymbol", "esri/graphic", "esri/geometry/Point", "esri/SpatialReference", "esri/Color", "esri/geometry/projection", "dojo/domReady!"], function (Map, Draw, SimpleMarkerSymbol, Graphic, Point, SpatialReference, Color, projectionEngine) {
		projectionEngine.load().then(function() {
			var map = new Map("mapDiv", {
				basemap: "streets",
				zoom: 3
			});

			map.on("load", function() {
				var markerSymbol = new SimpleMarkerSymbol();
				markerSymbol.setPath("M16,4.938c-7.732,0-14,4.701-14,10.5c0,1.981,0.741,3.833,2.016,5.414L2,25.272l5.613-1.44c2.339,1.316,5.237,2.106,8.387,2.106c7.732,0,14-4.701,14-10.5S23.732,4.938,16,4.938zM16.868,21.375h-1.969v-1.889h1.969V21.375zM16.772,18.094h-1.777l-0.176-8.083h2.113L16.772,18.094z");
				markerSymbol.setColor(new Color("#00FFFF"));

				var point = new Point([524669.72858949, 914723.2758707441], new SpatialReference(2881));
				var projectedPoint = projectionEngine.project(point, map.spatialReference);
				map.graphics.add(new Graphic(projectedPoint, markerSymbol));
			});
		});
	});
&amp;lt;/script&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
	&amp;lt;div id="mapDiv"&amp;gt;&amp;lt;/div&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If working with browsers that don't support the client-side projection engine, an alternative is to use the server side &lt;A href="https://developers.arcgis.com/javascript/3/jsapi/geometryservice-amd.html#project" target="_self"&gt;GeometryService.project&lt;/A&gt;.&lt;/P&gt;</description>
    <pubDate>Fri, 26 May 2023 00:13:45 GMT</pubDate>
    <dc:creator>JoelBennett</dc:creator>
    <dc:date>2023-05-26T00:13:45Z</dc:date>
    <item>
      <title>Create a point/Polyline on Map with different projection</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/create-a-point-polyline-on-map-with-different/m-p/1292883#M81251</link>
      <description>&lt;P&gt;With below code, am just trying to add a point/Polyline on the map&amp;nbsp;&lt;/P&gt;&lt;P&gt;Spatial Reference is 2881&lt;/P&gt;&lt;P&gt;for Example POINT (914723.27587074414 524669.72858949) and&amp;nbsp;PolyLine(912367.09095057845 525239.943328321, 912374.28713041171 525217.16023740917)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried, symbology is not showing up&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;BR /&gt;&amp;lt;html&amp;gt;&lt;BR /&gt;&amp;lt;head&amp;gt;&lt;BR /&gt;&amp;lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;lt;meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"&amp;gt;&lt;BR /&gt;&amp;lt;title&amp;gt;Shapes and Symbols&amp;lt;/title&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;link rel="stylesheet" href="&lt;A href="https://js.arcgis.com/3.29/esri/css/esri.css" target="_blank"&gt;https://js.arcgis.com/3.29/esri/css/esri.css&lt;/A&gt;"&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;style&amp;gt;&lt;BR /&gt;#info {&lt;BR /&gt;top: 20px;&lt;BR /&gt;color: #444;&lt;BR /&gt;height: auto;&lt;BR /&gt;font-family: arial;&lt;BR /&gt;right: 20px;&lt;BR /&gt;margin: 5px;&lt;BR /&gt;padding: 10px;&lt;BR /&gt;position: absolute;&lt;BR /&gt;width: 115px;&lt;BR /&gt;z-index: 40;&lt;BR /&gt;border: solid 2px #666;&lt;BR /&gt;border-radius: 4px;&lt;BR /&gt;background-color: #fff;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;html, body, #mapDiv {&lt;BR /&gt;padding: 0;&lt;BR /&gt;margin: 0;&lt;BR /&gt;height: 100%;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;button {&lt;BR /&gt;display: block;&lt;BR /&gt;}&lt;BR /&gt;&amp;lt;/style&amp;gt;&lt;BR /&gt;&amp;lt;script src="&lt;A href="https://js.arcgis.com/3.29/" target="_blank"&gt;https://js.arcgis.com/3.29/&lt;/A&gt;"&amp;gt;&amp;lt;/script&amp;gt;&lt;BR /&gt;&amp;lt;script&amp;gt;&lt;BR /&gt;var map, tb;&lt;/P&gt;&lt;P&gt;require([&lt;BR /&gt;"esri/map", "esri/toolbars/draw",&lt;BR /&gt;"esri/symbols/SimpleMarkerSymbol",&lt;BR /&gt;"esri/graphic", "esri/geometry/Point", "esri/SpatialReference",&lt;BR /&gt;"esri/Color", "dojo/domReady!"&lt;BR /&gt;], function (&lt;BR /&gt;Map, Draw,&lt;BR /&gt;SimpleMarkerSymbol,&lt;BR /&gt;Graphic, Point, SpatialReference,&lt;BR /&gt;Color&lt;BR /&gt;) {&lt;BR /&gt;map = new Map("mapDiv", {&lt;BR /&gt;basemap: "streets",&lt;BR /&gt;zoom: 3&lt;BR /&gt;});&lt;BR /&gt;var markerSymbol = new SimpleMarkerSymbol();&lt;BR /&gt;markerSymbol.setPath("M16,4.938c-7.732,0-14,4.701-14,10.5c0,1.981,0.741,3.833,2.016,5.414L2,25.272l5.613-1.44c2.339,1.316,5.237,2.106,8.387,2.106c7.732,0,14-4.701,14-10.5S23.732,4.938,16,4.938zM16.868,21.375h-1.969v-1.889h1.969V21.375zM16.772,18.094h-1.777l-0.176-8.083h2.113L16.772,18.094z");&lt;BR /&gt;markerSymbol.setColor(new Color("#00FFFF"));&lt;/P&gt;&lt;P&gt;var symbol;&lt;BR /&gt;symbol = markerSymbol;&lt;BR /&gt;var point = new Point([524669.72858949, 914723.2758707441], new SpatialReference({ wkid: 2881 }));&lt;BR /&gt;map.graphics.add(new Graphic(point, symbol));&lt;/P&gt;&lt;P&gt;});&lt;BR /&gt;&amp;lt;/script&amp;gt;&lt;BR /&gt;&amp;lt;/head&amp;gt;&lt;BR /&gt;&amp;lt;body&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;div id="mapDiv"&amp;gt;&amp;lt;/div&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/body&amp;gt;&lt;BR /&gt;&amp;lt;/html&amp;gt;&lt;/P&gt;</description>
      <pubDate>Thu, 25 May 2023 00:18:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/create-a-point-polyline-on-map-with-different/m-p/1292883#M81251</guid>
      <dc:creator>Pa_Lotus</dc:creator>
      <dc:date>2023-05-25T00:18:07Z</dc:date>
    </item>
    <item>
      <title>Re: Create a point/Polyline on Map with different projection</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/create-a-point-polyline-on-map-with-different/m-p/1293337#M81262</link>
      <description>&lt;P&gt;It looks like you will need to project your geometries before adding them to the map.&amp;nbsp; The preferred way to do this is via &lt;A href="https://developers.arcgis.com/javascript/3/jsapi/esri.geometry.projection-amd.html" target="_self"&gt;the client-side projection engine&lt;/A&gt;&amp;nbsp;like shown below:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
&amp;lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"&amp;gt;
&amp;lt;meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"&amp;gt;
&amp;lt;title&amp;gt;Sapes and Symbols&amp;lt;/title&amp;gt;
&amp;lt;link rel="stylesheet" href="https://js.arcgis.com/3.29/esri/css/esri.css"&amp;gt;
&amp;lt;style&amp;gt;
	#info {
		top: 20px;
		color: #444;
		height: auto;
		font-family: arial;
		right: 20px;
		margin: 5px;
		padding: 10px;
		position: absolute;
		width: 115px;
		z-index: 40;
		border: solid 2px #666;
		border-radius: 4px;
		background-color: #fff;
	}

	html, body, #mapDiv {
		padding: 0;
		margin: 0;
		height: 100%;
	}

	button {
		display: block;
	}
&amp;lt;/style&amp;gt;
&amp;lt;script src="https://js.arcgis.com/3.29/"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script&amp;gt;
	require(["esri/map", "esri/toolbars/draw", "esri/symbols/SimpleMarkerSymbol", "esri/graphic", "esri/geometry/Point", "esri/SpatialReference", "esri/Color", "esri/geometry/projection", "dojo/domReady!"], function (Map, Draw, SimpleMarkerSymbol, Graphic, Point, SpatialReference, Color, projectionEngine) {
		projectionEngine.load().then(function() {
			var map = new Map("mapDiv", {
				basemap: "streets",
				zoom: 3
			});

			map.on("load", function() {
				var markerSymbol = new SimpleMarkerSymbol();
				markerSymbol.setPath("M16,4.938c-7.732,0-14,4.701-14,10.5c0,1.981,0.741,3.833,2.016,5.414L2,25.272l5.613-1.44c2.339,1.316,5.237,2.106,8.387,2.106c7.732,0,14-4.701,14-10.5S23.732,4.938,16,4.938zM16.868,21.375h-1.969v-1.889h1.969V21.375zM16.772,18.094h-1.777l-0.176-8.083h2.113L16.772,18.094z");
				markerSymbol.setColor(new Color("#00FFFF"));

				var point = new Point([524669.72858949, 914723.2758707441], new SpatialReference(2881));
				var projectedPoint = projectionEngine.project(point, map.spatialReference);
				map.graphics.add(new Graphic(projectedPoint, markerSymbol));
			});
		});
	});
&amp;lt;/script&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
	&amp;lt;div id="mapDiv"&amp;gt;&amp;lt;/div&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If working with browsers that don't support the client-side projection engine, an alternative is to use the server side &lt;A href="https://developers.arcgis.com/javascript/3/jsapi/geometryservice-amd.html#project" target="_self"&gt;GeometryService.project&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Fri, 26 May 2023 00:13:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/create-a-point-polyline-on-map-with-different/m-p/1293337#M81262</guid>
      <dc:creator>JoelBennett</dc:creator>
      <dc:date>2023-05-26T00:13:45Z</dc:date>
    </item>
  </channel>
</rss>

