Popup Configuration

2611
7
03-02-2016 02:02 PM
QaziIqbal
New Contributor III

I have created an application. I have created a custom widget for searching parcels. Once the parcel is found, it highlights it, zooms to it and opens a info window (popup). The popup window is customized to include a link. When the users clicks on the link it generates a dialog and I am creating an <iframe inside the dialog. I am setting the src for the iframe a php web page passing the parcel id as pin. This whole thing works fine when user clicks on the link, it opens the tax information of that particular parcel in the dialog.

Now I want that if any user clicks on any parcel, it should do the same thing (Highlight that parcel, zoom to it and then open the same info window with the link to open the dialog.

In the arcgis online popup configuration, I do not see any way to create a dialog on clicking on the link. This can be done by creating an additional widget which will let the user to click on parcel, but we want this identify feature to be there for all time on the parcel layer.

I tried to put the code MapManager.js by creating a new on click event

mapOnClick  = on(map, "click", lang.hitch(this, this._identifyParcel));

it activated the identify on map click, but the problem is that when someone click on graphic widget or any other layer which has map.onclick event associated with it, the parcel identify does not get disabled that time.

Does anyone have any idea how this can be accomplished in a cleaner way.

Thanks

Qazi

Tags (2)
0 Kudos
7 Replies
RobertScheitlin__GISP
MVP Emeritus

Qazi,

   Instead of adding a map click event just add a click event to the parcels FeatureLayer.

QaziIqbal
New Contributor III

Robert

I did not exactly get your point, Can you please explain it little more so that I take the correct approach.

Thanks

Qazi

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Qazi,

   You are now applying a click event listener to the map object. Each layer has a click event that you can attach an event to also. If you attach the click event to the layer instead of the map then you will not have to worry any other layers getting the map click.

0 Kudos
QaziIqbal
New Contributor III

Robert

In that case, the click event will always be attached with the layer which works fine. But now the problem arises when the user enables popup on any other layer (For example, Firestations). In this case when user click Firestation, it attaches the click event to firestation and also our parcels layer click event is active too. In this case I see Firestation as well as parcel selected and both popups try to show.

The logic should be that if any popup of any layer is enabled, then the click event on the parcel layer should be disabled and if none of the layers is enabled then the popup of parcel layer should stay enabled.

Does it make any sense??

Qazi

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Qazi,

   Are you sure this is the case

In this case I see Firestation as well as parcel selected and both popups try to show.

and why is this what you want:

The logic should be that if any popup of any layer is enabled, then the click event on the parcel layer should be disabled and if none of the layers is enabled then the popup of parcel layer should stay enabled.

Because I am not sure how you are going to accomplish this.

0 Kudos
QaziIqbal
New Contributor III

Robert

Below is the link to our mapping application

http://gis.fultoncountyga.gov/Apps/PropertyMapViewer

This application is built using legacy javascript coding. I am trying convert this into Web AppBuilder format. You can see in this application, the citizens are used to get the parcel info just by clicking on the parcel. In the info window, there is a link to Property Profile which opens a dialog. 

If they click on graphic point tool, the parcel identify tool is disabled for a while.

If you have any other idea how to accomplish similar function so that we give citizens similar options. It will be much appreciated.

Qazi

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Qazi,

   When I enable a popup for say my city limits and then I attach a click event to my Parcels layer and do some custom popup work and then click on the map where a parcel is inside a city limit I get the custom parcel popup with navigation arrow and 1 of 2 at the top to click to go to the second record in the popup which is the city limit popup. What is wrong with that from a users perspective?

0 Kudos