Popup.open() function used to highlight feature have an unstable error @ ArcGIS for JavaScript 4.20

448
4
Jump to solution
08-23-2021 09:18 AM
ForyondChao
New Contributor II

My Server is ArcGIS Server 10.2,I published the mapping service using ArcMap 10.2 , and the layers data from database (SQL Server 2019) directly.  When I don't register the database, publishing maps automatically copies the data from the database to the server ,  a new unique field called OBJECTID is automatically added to the layer properties table ,  Popup is right now.

but, when I register the database to ArcGIS Server,  I  call the  popup.open()  function to show a feature's property,  some unfixed errors have occurred.   I noticed that the new unique field added by ArcGIS changed from OBJECTID to ESRI_OID,  I modified the codes, but, error still.  The error appeared is that when I popup a feature, the highlight geometry is part of the target feature or sometime is other feature. something like this:

ForyondChao_2-1629734883192.png

but now the geometry obtained from server is correct, there are 6 points for the geometry.

ForyondChao_3-1629734985248.png

Here is my code.

ForyondChao_4-1629735164174.png

Could you please tell me how to fix this bug  or  possible reasons? Looking forward to your reply, Thanks!

 

0 Kudos
1 Solution

Accepted Solutions
ForyondChao
New Contributor II
I used a simple method to get around this problem

1. Turn popUp's built-in highlighting off.

const view = new MapView({

 popup:{highlightEnabled:false}

})

2. Use the default graphic in the View to add color for geometry every time it is selected.

sym= new {

type:"simple-fill",

color:[0,255,255,0.5],

style:"solid",

outline:{color:[255,255,0], width:1, style:"solid"}

}

view.graphics.add(new Graphic({geometry:geometry, symbol:sym}));

Now I can achieve my goal, thanks to the forum!

View solution in original post

0 Kudos
4 Replies
GarryGoldberg
New Contributor

There are many pros and cons associated with software development outsourcing https://mlsdev.com/blog/how-to-make-a-booking-app . Many companies view software development outsourcing as the ideal solution to short term needs. The process doesn't take as long as a typical software development cycle and there are fewer costs. There are also many benefits associated with software development outsourcing. For instance, when teams with an in-house software developer or development team are hired, these individuals usually don't have the same level of experience as those that work for outsourcing companies. These teams typically provide several years of experience and training, so your software will be at the level your company requires while saving money in the long run.

0 Kudos
ForyondChao
New Contributor II

Hi  GarryGoldberg!

How do you to solve the problem ? 

0 Kudos
ForyondChao
New Contributor II
I used a simple method to get around this problem

1. Turn popUp's built-in highlighting off.

const view = new MapView({

 popup:{highlightEnabled:false}

})

2. Use the default graphic in the View to add color for geometry every time it is selected.

sym= new {

type:"simple-fill",

color:[0,255,255,0.5],

style:"solid",

outline:{color:[255,255,0], width:1, style:"solid"}

}

view.graphics.add(new Graphic({geometry:geometry, symbol:sym}));

Now I can achieve my goal, thanks to the forum!
0 Kudos
kukiyang
New Contributor

this is awesome, try it out! https://word-unscrambler.io

0 Kudos