Select to view content in your preferred language

My Government Services - GovernmentServices.mxd data requirements

2204
3
12-17-2012 06:42 AM
AndrewFarrar
Frequent Contributor
Hello,

I have just published the My Government Services Application, and am getting an error message that I did not expect.  When the application starts up in the browser, I get "Error: Atleast one polygon layer is mandatory for this application.".  I am assuming that this is referencing the fact that my GovernmentServices.mxd service contains only point data, as none of our government services are represented by polygons (example: we have recycling centers instead of curb-side pickup). 

I traced the error into the errormessages.xml and then into the default.html which generates the error message during a check on line 159.  Commenting that section out bypasses the error, but the application still does nothing.  It just opens the default.html and sits there on a blank map.  I haven't been able to trace it any further than that in trying to find out where else it is looking for a polygon layer. 

I wasn't aware of this requirement, and was wondering if anyone had a similar experience.  I don't really have any government service polygon layers to add, so if I could somehow get rid of the sections of code that are calling for polygons, that would be great.

Thanks!
0 Kudos
3 Replies
LindsayThomas
Esri Contributor
Hi Andrew,

I think I know what the issue is. 

If you look at the section of the config file below you will see two little sections, Street Cleaning & Libraries

The street cleaning section is expecting a polygon.
The libraries section is expecting a point.

They are very similar, but slightly different.

If you intend on configuring your application with only point data, you should make sure that your configuration file is using configurations based on the pattern you see with libraries, instead of street cleaning.

Hopefully this helps,
Cheers,
Lindsay Thomas

StreetCleaning:
                 {
                     Name: "Street Cleaning",
                     Image: "images/streetCleaning.png",
                     HasRendererImage: false,
                     ServiceUrl: "http://arcgis-tenone2012-1974758903.us-west-1.elb.amazonaws.com/arcgis/rest/services/GovernmentServices/MapServer/7",
                     FieldNames: [
                                    { ServiceAvailability:
                                                          [
                                                             { FieldName: "WEEKONE", DisplayText: "Week 1" },
                                                             { FieldName: "WEEKTWO", DisplayText: "Week 2" },
                                                             { FieldName: "WEEKTHREE", DisplayText: "Week 3" },
                                                             { FieldName: "WEEKFOUR", DisplayText: "Week 4" }
                                                           ]
                                    },
                                    { Field: "Agency: ${AGENCY}" },
                                    { Field: "Contact: ${CONTACT}" },
                                    { Field: "Phone: ${PHONE}" },
                                     { Links:
                                                           [
                                                              { DisplayText: "Website", FieldName: "AGENCYURL" },
                                                              { DisplayText: "Email", FieldName: "EMAIL" }
                                                           ]
                                     }
                                 ],
                     Color: "#00FF00",
                     isRendererColor: true,
                     LayerVisibility: true
                 },
          Libraries:
                 {
                     Name: "Libraries",
                     Image: "images/library.png",
                     HasRendererImage: false,
                     ServiceUrl: "http://arcgis-tenone2012-1974758903.us-west-1.elb.amazonaws.com/arcgis/rest/services/GovernmentServices/MapServer/4",
                     distance: 4,
                     FieldNames: [
                                    { FieldName: "FacilitySitePoint.NAME" },
                                    { FieldName: "FacilitySitePoint.FULLADDR" },
                                    { FieldName: "GovServiceInfo.PHONE" }
                                 ],
                     LayerVisibility: true,
                     ShowBeyondBuffer: true
                 },
0 Kudos
AndrewFarrar
Frequent Contributor
Hi Lindsay,

Thanks for the response, I appreciate your help!

I have my config file set up to only reference the points.  There are no polygons in my GovernmentServices service, so I got rid of all of the polygon services being referenced in the config file.  That is why the error was unexpected, since I got rid of all the polygon layer references. 

I am using the previous release of the MygovernmentServices 10.1 (the one right before the fall release).  My config file doesn't look quite like yours, but is fundamentally the same. 

So if there isn't any other place in the application that is calling for polygons, then it might just be a communication issue with the server.  After the error message pops up, nothing else happens... no basemap, nothing.  I can access the services just fine through the arcgis REST services directory, but the application just won't pull them.
0 Kudos
AndrewFarrar
Frequent Contributor
Just giving an update -- i've made some progress. I found a boundary to put into the piBoundary feature class to be included in the GovernmentServices service.  I also added it to the config file replicating the pattern for the other polygon layers.  This got rid of the error message saying that a polygon layer was neccessary for the application. 

Now when the application opens up, the splash screen comes up, but none of my map services are displayed.  Clicking on the address search button generates this error message:

[INDENT][/INDENT]"map.getLayer(baseMapLayerCollection[bMap].Key) is undefined"

I don't know what I'm missing since I'm referencing the outside URL in all of the service layers for the config file.  Even with that there seems to be a communication issue with the server
0 Kudos