|
POST
|
HI want to change style of vertices points of polygon like we have bydefualt blue and gray, if i want to change it size and color . Please provide any example
... View more
03-11-2020
02:34 AM
|
0
|
1
|
662
|
|
POST
|
Its not working, It only show overlay on whole map. like this my polygon also covered with overlay This is my code: function addGraphics() { //pass geographic vertices const vertices = <?php echo json_encode($map_ring_coordinate);?>; const polygon = createGeometry(vertices); //console.log(polygon); validSymbol = createSymbol([255, 121, 25, 0.0], "solid", 2, [ 255, 121, 25 ]); newDevelopmentGraphic = new Graphic({ geometry: polygon, symbol: validSymbol, attributes: { newDevelopment: "new store" } }); graphicsLayer.add(newDevelopmentGraphic); var mapExtent = view.extent.expand(9); var overlayGeom = geometryEngine.difference(mapExtent, newDevelopmentGraphic.geometry); var symbol2 = { type: "simple-fill", style: "solid", color: [129, 129, 129, 0.5], outline: { color: [255, 255, 255, 0], width: 0 } }; overLayGra = new Graphic({ geometry: overlayGeom, symbol: symbol2 }); graphicsLayer.add(overLayGra); } I don't want to move and reshape the graphics so their is no need to think of it
... View more
03-10-2020
08:58 PM
|
0
|
1
|
2363
|
|
POST
|
ok robert thanks for the guidance, i will start new threads for other question. Can you explain why you use else case here to add symbol to graphics. if ( event.toolEventInfo && (event.toolEventInfo.type === "move-stop" || event.toolEventInfo.type === "reshape-stop") ) { sketchViewModel.complete(); } else if (event.state === "cancel" || event.state === "complete") { //check if the graphics are done being reshaped, printout updated graphic's geometry and reshape stage. // graphic reshaping has been completed or cancelled sketchViewModel.update([graphic], { tool: "reshape" }); }else { graphic.symbol = validSymbol; } When we are creating symbol and add it to graphics newDevelopmentGraphic, is it not sufficient here?? validSymbol = createSymbol([255, 255, 255, 0.3], "solid", 2, [ 255, 121,5]); newDevelopmentGraphic = new Graphic({ geometry: webMercatorUtils.geographicToWebMercator(polygon), symbol: validSymbol, attributes: { newDevelopment: "new store" } });
... View more
03-09-2020
12:07 AM
|
0
|
0
|
1221
|
|
POST
|
Hi, i want to create a pane with buttons on side of map like this, with height equal to map div
... View more
03-05-2020
11:09 PM
|
0
|
1
|
2316
|
|
POST
|
It worked thank you but their is another issue, that i want o change polygon fillcolor and outline color and make the line dashed by adding this line after graphics add to graphics layer , it do not take my styling, but take default styling of polygon graphics By the way is their any style for dashed line i couldn't find any here SimpleFillSymbol | ArcGIS API for JavaScript 4.14 i want my style of editable polygon like this, validSymbol = createSymbol([255, 255, 255, 0.3], "dash", 2, [ 255, 121, 25 but it only appear when i comment your recommended line //now the graphic has been added to the graphics layer and the SketchviewMdoel is created
sketchViewModel.update([newDevelopmentGraphic], {tool: "reshape"});
... View more
03-05-2020
08:42 PM
|
0
|
2
|
1221
|
|
POST
|
I find this link and it uses shape files that i don't use, and couldn't understand how to do it Fade back map outside of polygon
... View more
03-05-2020
07:46 PM
|
0
|
3
|
2363
|
|
POST
|
Its done, it was some minor error, btw thanks alot for ur kind efforts. So now i will create basemap buttons with the same method now, but what method do i call on click to change basemap
... View more
03-05-2020
03:42 AM
|
0
|
2
|
3028
|
|
POST
|
OK now it is clickable, but it do only zoom where ever it is on world map, it do not goto to that exact location of x and y axis(lat,long) view.when(function() { // Add the boundary polygon and new lot polygon graphics addGraphics(); // create DOM object var recenterBtn = domConstruct.toDom("<div class='map-button esri-component esri-locate esri-widget--button esri-widget' role='button' title='Recenter'><span aria-hidden='true' role='presentation' class='esri-icon esri-icon-globe'></span></div>"); // add to view view.ui.add(recenterBtn, "bottom-right"); // add button click listener recenterBtn.addEventListener('click', recenterView); function recenterView(){ view.goTo({ center: ['<?=$map_xy_coordinate['x']?>', '<?=$map_xy_coordinate['y']?>'], zoom: 15 }); } });
... View more
03-05-2020
02:51 AM
|
0
|
0
|
3028
|
|
POST
|
I have a simple map with polygons on graphics layer, i need to fade map outside that polygon and show polygon as a hole in the map. I get some relative answer in older version, but it is not helpful. I want to show like this image My code is below <script> require(["esri/views/MapView", "esri/WebMap", "esri/Graphic", "esri/layers/GraphicsLayer", "esri/geometry/Polygon", "esri/geometry/SpatialReference" ], function (MapView, WebMap, Graphic, GraphicsLayer, Polygon, SpatialReference) { let validSymbol, newDevelopmentGraphic; /************************************************************ * Creates a new WebMap instance. A WebMap must reference * a PortalItem ID that represents a WebMap saved to * arcgis.com or an on-premise portal. * * To load a WebMap from an on-premise portal, set the portal * url with esriConfig.portalUrl. ************************************************************/ var webmap = new WebMap({ portalItem: { // autocasts as new PortalItem() id: "" } }); /************************************************************ * Set the WebMap instance to the map property in a MapView. ************************************************************/ var view = new MapView({ map: webmap, container: "viewDiv", center: ['<?=$map_xy_coordinate['x']?>', '<?=$map_xy_coordinate['y']?>'], zoom: 15 }); var graphicsLayer = new GraphicsLayer(); webmap.add(graphicsLayer); view.when(function() { // Add the boundary polygon and new lot polygon graphics addGraphics(); }); function addGraphics() { //pass geographic vertices const vertices = <?php echo json_encode($map_ring_coordinate);?>; const polygon = createGeometry(vertices); //console.log(polygon); validSymbol = createSymbol([0, 170, 255, 0.2], "solid", 2, [ 255, 255, 255 ]); newDevelopmentGraphic = new Graphic({ geometry: polygon, symbol: validSymbol, attributes: { newDevelopment: "new store" } }); graphicsLayer.addMany([newDevelopmentGraphic]); } function createGeometry(vertices) { return new Polygon({ rings: vertices, spatialReference: new SpatialReference({wkid:4326}) }); } function createSymbol(color, style, width, outlineColor) { return { type: "simple-fill", style: style, color: color, outline: { color: outlineColor, width: width } }; } }); </script>
... View more
03-04-2020
11:50 PM
|
0
|
5
|
2618
|
|
POST
|
HI robert this link need token , i think it is not shareble or public, can you make it accessible to me
... View more
03-04-2020
10:08 PM
|
0
|
1
|
1481
|
|
POST
|
Hi I am trying to get custom recenter button and basemap 3 custom button like below image. Is their any example
... View more
03-04-2020
10:06 PM
|
0
|
8
|
3272
|
|
POST
|
I have tried to edit it after this line in my code. But it doesn't workout for me. webmap.add(graphicsLayer); sketchViewModel.update([graphic], { tool: "reshape" });
... View more
03-04-2020
09:07 PM
|
0
|
4
|
1428
|
|
POST
|
Hi I am trying to display the boundary of regions(state) of new zealand country. From where i can get the feature layer for the boundary of region like this url below var featureLayer = new FeatureLayer({ url: "https://services.arcgis.com/V6ZHFr6zdgNZuVG0/arcgis/rest/services/Landscape_Trees/FeatureServer/0" }); map.add(featureLayer);
... View more
03-04-2020
05:30 AM
|
0
|
5
|
1679
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 12-28-2020 10:30 PM | |
| 1 | 12-27-2020 09:03 PM | |
| 1 | 05-17-2020 10:15 PM | |
| 2 | 04-21-2020 10:39 PM | |
| 3 | 09-09-2020 08:44 PM |
| Online Status |
Offline
|
| Date Last Visited |
04-30-2024
05:15 AM
|