|
POST
|
Hi A default popup appear when i click on vertice of polygon. As i m also using markers with popup in my app, but they also appear on my vertices with default body. The line in bold shows my popup, but it should not work for polygon vertices. // This function is called when a user clicks on the view. function setUpGraphicClickHandler() { view.on("click", function(event) { view.hitTest(event).then(function(response) { var results = response.results; if(results.length === 0){ sketchViewModel.complete(); markersketchViewModel.complete(); } // Check if the new development graphic and temp graphics with attribute named newDevelopment was clicked and pass // the graphic to sketchViewModel.update() with reshape tool. results.forEach(function(result) { if ( result.graphic.layer === sketchViewModel.layer && result.graphic.attributes && result.graphic.attributes.newDevelopment ) { sketchViewModel.update([result.graphic], { tool: "reshape" }); } else if( result.graphic.layer === markersketchViewModel.layer && result.graphic.attributes && result.graphic.attributes.newDevelopment){ markersketchViewModel.update([result.graphic], { tool: "reshape" }); } else if(sketchViewModel.state !== 'active'){ sketchViewModel.cancel(); // view.popup.open({features: [result.graphic], location: result.graphic.geometry}); } else if(markersketchViewModel!== 'active' ){ markersketchViewModel.cancel(); view.popup.open({features: [result.graphic], location: result.graphic.geometry}); } }); }); }); }//End setUpGraphicClickHandler
... View more
05-11-2020
12:35 AM
|
0
|
16
|
3846
|
|
POST
|
Hi My polygon vertices remain when i remove graphics. My polygons come from db, as well i created new polygons on the spot. While one of many polygon coming from db always stay editable and one of new polygon created always remain editablle. the one editable polygon always leave its vertices on removal, even when i used sketchViewModel.complete(); I tried alot , but didn't get it how to get it fixed. Any help will be appriceable. //Clear All method jQuery('#main').on('click', '.clear_all', function(){ //clear all graphics added to graphics layer clearAll=true; sketchViewModel.complete(); graphicsLayer.removeAll(); }); //Double click to delete boundaries view.on("double-click", function(event){ view.hitTest(event).then(function(response) { var results = response.results; sketchViewModel.complete(); results.forEach(function(result) { if(result.graphic.geometry.type==='polygon'&&result.graphic.layer === sketchViewModel.layer && result.graphic.attributes && result.graphic.attributes.newDevelopment){ graphicsLayer.remove(result.graphic); } }); }); }); For making them editable, i use this code below view.when(function() { .. .. // Listen to sketchViewModel's update event to do graphic reshape validation sketchViewModel.on(["update", "undo", "redo"], onGraphicUpdate); //now the graphic has been added to the graphics layer and the SketchviewMdoel is created //to show it as editable when page load sketchViewModel.update([newDevelopmentGraphic], {tool: "reshape"}); });//End View.When function onGraphicUpdate(event) { // get the graphic as it is being updated const graphic = event.graphics[0]; // check if the update event's the toolEventInfo.type is move then stop move event if (event.toolEventInfo && event.toolEventInfo.type.includes("move")){ sketchViewModel.cancel(); markersketchViewModel.cancel(); } // If toolEventInfo.type is reshape-stop then it means user finished moving or reshaping the graphic, call complete method. This will change update event state to complete and we will check the validity of the graphic location. if ( event.toolEventInfo && (event.toolEventInfo.type === "move-stop" || event.toolEventInfo.type === "reshape-stop") ) { sketchViewModel.complete(); markersketchViewModel.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 graphic.attributes.state = "updated"; sketchViewModel.update([graphic], { tool: "reshape" }); } else{ graphic.symbol = validSymbol; } }//End OnGraphicsUpdate // This function is called when a user clicks on the view. function setUpGraphicClickHandler() { view.on("click", function(event) { view.hitTest(event).then(function(response) { var results = response.results; if(results.length === 0){ sketchViewModel.complete(); markersketchViewModel.complete(); } // Check if the new development graphic and temp graphics with attribute named newDevelopment was clicked and pass // the graphic to sketchViewModel.update() with reshape tool. results.forEach(function(result) { if ( result.graphic.layer === sketchViewModel.layer && result.graphic.attributes && result.graphic.attributes.newDevelopment ) { sketchViewModel.update([result.graphic], { tool: "reshape" }); } else if(sketchViewModel.state !== 'active'){ sketchViewModel.cancel(); view.popup.open({features: [result.graphic], location: result.graphic.geometry}); } }); }); }); }//End setUpGraphicClickHandler
... View more
05-08-2020
04:08 AM
|
0
|
5
|
1770
|
|
POST
|
Is it possible to make topo layer lines more bold and different color through js or any other way. Currently It looks like this
... View more
05-07-2020
12:16 AM
|
0
|
4
|
1709
|
|
POST
|
How to use this property with, no example given with property specified 0,1,2 view.on("click", function(event) {
... View more
05-06-2020
05:26 AM
|
0
|
1
|
2560
|
|
POST
|
is their any right click event?as double click bydefault zoom also while deleting. I searched it, but didn't get any right-click event
... View more
05-06-2020
03:06 AM
|
0
|
3
|
2560
|
|
POST
|
sir my double click listener is running fine, i have consoled and get the boundary clicked as polygon , but i didn't get it how to delete it. Both of these method below not working to delete /*graphicslayer.remove(result.graphic); view.graphics.remove(result.graphic);*/ While my console in this code return my clicked polygon as graphic
... View more
05-05-2020
05:40 AM
|
0
|
5
|
2560
|
|
POST
|
I tried 2 methods, both don't work out, while console return me the exact that polygon that i clicked, but still stucked to delete it. I want to delete polygons of graphics layer only. view.on("double-click", function(event){ view.hitTest(event).then(function(response) { var results = response.results; results.forEach(function(result) { if(result.graphic.geometry.type==='polygon'&&result.graphic.layer === sketchViewModel.layer && result.graphic.attributes && result.graphic.attributes.newDevelopment){ console.log(result.graphic); /*graphicslayer.remove(result.graphic); view.graphics.remove(result.graphic);*/ } }); }); });
... View more
05-05-2020
03:20 AM
|
0
|
7
|
2560
|
|
POST
|
Hi Victor I m working on 4.14 version i used your example and this link Basemap | ArcGIS API for JavaScript 4.15 and created this code, but it doesn't work out. I don't know where i am gettig wrong. Can any one please help me out.
... View more
05-04-2020
11:14 PM
|
0
|
2
|
3554
|
|
POST
|
Hi Sir, I tried your way, in console, i get that exact polygon clicked, but i could not able to remove that graphics from map with graphicslayer.remove method Am i missing something?? Do i have to use other function. view.on("double-click", function(event){ view.hitTest(event).then(function(response) { var results = response.results; results.forEach(function(result) { if(result.graphic.geometry.type==='polygon'&&result.graphic.layer === sketchViewModel.layer && result.graphic.attributes && result.graphic.attributes.newDevelopment){ console.log(result.graphic); graphicslayer.remove(result.graphic); } }); }); });
... View more
05-04-2020
03:44 AM
|
0
|
8
|
2560
|
|
POST
|
I didn't understand, can u please give me any example, As i do not use any feature layer, just having graphics layer. Like you said i have a basemap of satellite for example, and i want those lines to be added, but i don't know how??? Also can i change color of topo lines??? I want to make new basemap satellite topo This is my code below var topoBtn =domConstruct.toDom("<div class='map-button esri-component esri-widget--button esri-widget topo mapbtncolor' role='button' title='topo'>TOPO<span aria-hidden='true' role='presentation'></span></div>") ; var satelliteBtn = domConstruct.toDom("<div class='map-button esri-component esri-widget--button esri-widget sat basmapcolor' id='satt' role='button' title='sattelite'>SATELLITE<span aria-hidden='true' role='presentation'></span></div>"); function setbasemap(basemap){ webmap.basemap = basemap; } topoBtn.addEventListener('click', function(){ setbasemap('topo'); }); satelliteBtn.addEventListener('click', function(){ setbasemap('satellite'); });
... View more
05-04-2020
03:30 AM
|
0
|
4
|
3554
|
|
POST
|
Hi i am placing markers, but the issue is my marker picture appear centre to that clicked position, I want to know how to adjust marker picture to place its pointed tip to that clicked location
... View more
04-30-2020
03:22 AM
|
0
|
1
|
719
|
|
POST
|
Hi, I want to know how to delete that boundary or polygon which is doubleclicked. I know we can do it like this, but how to know that which polygon got clicked so that i ll get its graphics. My polygons coming from db and i am createing new polygons also. found this link, But don't know how it works for 4.14 Selecting and removing graphic (by rings array) in ArcGIS JSapi 3.x Robert Scheitlin, GISP u have answered the above question, is their any otherway, i can delete my editable polygons one at a time graphicslayer.remove(gra);
... View more
04-30-2020
03:20 AM
|
0
|
10
|
3009
|
|
POST
|
Hi i want to know, how to combine 2 basemap layers to make a new one for satellite and topo, where i want topo to be on top of satellite, and i want to change color of the lines to red or any other color for these kind of topo lines. I got a link on older version Multiple Layers for 1 basemap . Do it work as my needs. bcz it include basemaplayer also
... View more
04-29-2020
03:26 AM
|
0
|
7
|
3777
|
|
POST
|
Yes sir, you are right, I m working on it, it may be due to https issue, further i am working to write specifications for the button on which i have to download map extracted its rings and point lat/long from the db.
... View more
04-29-2020
02:54 AM
|
0
|
2
|
4463
|
| 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
|