Highlight the related attribute with color based on selected PIN

759
10
06-04-2018 06:10 AM
G_KrishnaRao
New Contributor

Hello..

I have black dots i.e (Assets) in Map page and each asset has different Asset ID.

My requirement is when i select the PIN in the map, the respective asset id's in map should get highlighted with any color.

My Problem is I am unable to read/identify the asset based on the selection.Therefore i am unable to highlight any color on the same.

I have tried a lot but not get success.

Any help is appreciated.

Thanks in advance.

0 Kudos
10 Replies
KenBuja
MVP Esteemed Contributor

Can you post the code of what you've tried so far?

0 Kudos
G_KrishnaRao
New Contributor

HI,

Thanks for the reply.

Please find the attached function which is written in ARCGISMap.JS Page

0 Kudos
KenBuja
MVP Esteemed Contributor

What are the objects in "data" that are getting returned by the ajax query? Are they features or something else? If they are features, normally you would find the attributes by

assetid = data[i].attributes.AssetID

You should use the debugger tools in your browser to examine the "data" object to determine where the attributes are stored.

What are the AssetIDs? You're trying to create graphics from the splitassetsids, but creating graphics requires either a geometry or a JSON object. You're then trying to add splitassetsids to the map directly, not the graphics you tried to create.

Finally, you're mixing up using AMD and legacy-style coding.

var sls = new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID, new Color(markerHighlightColor), 4);
var polyGraphic = new esri.Graphic(splitassetids, symbol);

You should use just AMD style.

G_KrishnaRao
New Contributor

Hi,

Please find the document(attached).

0 Kudos
KenBuja
MVP Esteemed Contributor

Please just write your comments in this thread, not in a separate document attachment.

How are the black dots added to the map? Are they a separate feature layer or just graphics? It's difficult to diagnose without seeing more of your code

0 Kudos
G_KrishnaRao
New Contributor

Hi,

Sorry for the delayed response.

As per current update, i am now able to highlight the assets on pin click.

But now, the problem is highlight part is working only after doing zoom in

or zoom out in map.

I mean, when i am selecting any PIN then after doing zoom in or zoom out

the color is highlighting on the assets.

Is there any workaround, where i can click on PIN and highlight the asset

color without zoom in or zoom out.

Awaiting for your reply.

Thanks in advance.

0 Kudos
G_KrishnaRao
New Contributor

HI ,

Hope you are doing well.

Any workaround for my previous issue.?

Awaiting for your reply.

On Thu, Jun 7, 2018 at 1:45 PM, JustLikeThat GK <krishnadew06@gmail.com>

0 Kudos
KenBuja
MVP Esteemed Contributor

What is your code?

0 Kudos
G_KrishnaRao
New Contributor

Hi,

Greetings for the day.

Here is the code attached.

on PIN click,after zoom in or zoom out the map then only i am able to see

the highlighted color.

I want to avoid zoom in and zoom out. Just on PIN click only the related

assets should be highlighted .

Awaiting for your reply.

0 Kudos