Select to view content in your preferred language

Public Maps Gallery template version 1.4  --Opening post

33436
175
11-22-2011 02:57 PM
Esriwebmap
Occasional Contributor


Please reply to this opening post to submit questions and comments about the Public Maps Gallery (PMG) template version 1.4.
Tags (2)
0 Kudos
175 Replies
MattDriscoll
Esri Contributor
Greetings;
I have created two address locators, one for address points and one for streets; I have combined them into a composite locator and published as a service in ArcGIS server. The spatial reference of participating locators are in state plane and the composite address locator in GCS_WGS_1984. Then in PMG template, I changed �??pmgConfig.locatorURL�?� variable in �??settings.optional.js�?� to point to my published locator service.

Now, when I access my PMG maps, and start typing in few characters in search box, I can see the autocomplete feature showing the related entries as I type. When I click on the search result to go to the location, the map pans to the coast of Africa and when I zoom out, I do see a point marked in the correct place. I don�??t know why the location is correctly marked but the map pans to a wrong place. I appreciate your help in this matter.

FYI, I used �??42105 churchpoint rd, gonzales�?� as my search criteria. You can see my locator returns X,Y very similar to ESRI�??s built in locator. The spatial reference of both of the following locators are 4326.
My Locator:
http://gis.apgov.us/APGarcGIS/rest/services/Locators/ApgCompositeSearch/GeocodeServer
Locator from PMG:
http://tasks.arcgis.com/ArcGIS/rest/services/WorldLocator/GeocodeServer
[ATTACH=CONFIG]14203[/ATTACH]




In the showResults function, the locator converts the point and extent separately from geographic to web mercator and then sets the extent and adds the graphic. It sounds like maybe the extent is already in web mercator or maybe the extent is not getting returned from the locator. It might be good to check and see if the locator is returning all columns and results and that the extent (west,south,east,north) is set. Can you console.log() an extent that is returned and see what it says?

Hope that helps.
0 Kudos
Parish_ofAscension
Emerging Contributor
In the showResults function, the locator converts the point and extent separately from geographic to web mercator and then sets the extent and adds the graphic. It sounds like maybe the extent is already in web mercator or maybe the extent is not getting returned from the locator. It might be good to check and see if the locator is returning all columns and results and that the extent (west,south,east,north) is set. Can you console.log() an extent that is returned and see what it says?

Hope that helps.


Thanks Matt for your help. Yes, my locator is not outputting extents. I don't know of a way to create such a locator, I haven't noticed any options related to extents while creating my locator. I've used the standard menu driven way to create my locator. Is there a way to make the locator output extents in addition to X,Y?

I was able to find a workaround for my issue. I changed the following lines in ShowResults function in layout.js. I've used the X,Y that my locator is returning and came up with a buffer around the point for the extents.
                var xminNew = parseFloat(geocodeResults[numResult].location.x-0.011);
  var yminNew = parseFloat(geocodeResults[numResult].location.y-0.011);
  var xmaxNew = parseFloat(geocodeResults[numResult].location.x+0.011);
  var ymaxNew =  parseFloat(geocodeResults[numResult].location.y+0.011);
This seems to work for now.

Regards,
Vijai
0 Kudos
MattDriscoll
Esri Contributor
Thanks Matt for your help. Yes, my locator is not outputting extents. I don't know of a way to create such a locator, I haven't noticed any options related to extents while creating my locator. I've used the standard menu driven way to create my locator. Is there a way to make the locator output extents in addition to X,Y?

I was able to find a workaround for my issue. I changed the following lines in ShowResults function in layout.js. I've used the X,Y that my locator is returning and came up with a buffer around the point for the extents.
                var xminNew = parseFloat(geocodeResults[numResult].location.x-0.011);
  var yminNew = parseFloat(geocodeResults[numResult].location.y-0.011);
  var xmaxNew = parseFloat(geocodeResults[numResult].location.x+0.011);
  var ymaxNew =  parseFloat(geocodeResults[numResult].location.y+0.011);
This seems to work for now.

Regards,
Vijai


Hi Vijai,

Yep, that will work! I'm not sure how to get a custom locator to output extents. I know for our locator, in order to get the extent North, West, South, East, with the addressToLocations function, you have to pass "*" to get the extent. Maybe it's the same with your locator?

.addressToLocations(address,["*"]);
0 Kudos
CameronMcCormick
Regular Contributor
Thanks Matt for your help. Yes, my locator is not outputting extents. I don't know of a way to create such a locator, I haven't noticed any options related to extents while creating my locator. I've used the standard menu driven way to create my locator. Is there a way to make the locator output extents in addition to X,Y?

I was able to find a workaround for my issue. I changed the following lines in ShowResults function in layout.js. I've used the X,Y that my locator is returning and came up with a buffer around the point for the extents.
                var xminNew = parseFloat(geocodeResults[numResult].location.x-0.011);
  var yminNew = parseFloat(geocodeResults[numResult].location.y-0.011);
  var xmaxNew = parseFloat(geocodeResults[numResult].location.x+0.011);
  var ymaxNew =  parseFloat(geocodeResults[numResult].location.y+0.011);
This seems to work for now.

Regards,
Vijai

Thanks to both Vijai and Matt for the answer, got it to work too!
0 Kudos
MattDriscoll
Esri Contributor
Thanks. I'll throw Vijai's fix in the code if it can't find the extent.
0 Kudos
MattDriscoll
Esri Contributor
Hello!

First, Thank you for the map gallery! It has made displaying our maps and applications soo much better and simpler for the public! I have two questions: I need my applications to open in a separate window when the users view them (cannot find where to do this!!). Some people find it difficult to navigate back to the gallery. Next, in the elections gallery (which only is using a simple viewer) my zoom arrows are not working?? I am not a programer, but have gained limited experience with all our online apps we have now.

Map Gallery: http://publicgis.bartowga.org/

Elections Gallery: Bottom Left Corner of Gallery or at http://publicgis.bartowga.org/elections/index.html

Thanks for the help in advance!

Jacqueline
Bartow GIS



Hi Jacqueline, Thanks for the feedback!

In settings.optional.js, there should be an option to open all gallery items in a new window. Try setting it to true. Let me know if that works for you.

// Open gallery thumbnail links in a new window/tab
pmgConfig.openGalleryNewWindow = false;


The 2nd problem is a bit trickier. It seems as if the map has no levels of detail set. I think the zoom bar isn't working correctly on arcgis.com either. http://www.arcgis.com/home/webmap/viewer.html?webmap=6727d675d12c4eb88e8ea7986186b313

Is there any way you can add levels of detail to the basemap? If not, i'll have to do some creative thinking.

Thanks
0 Kudos
ConnieAllen
New Contributor
Hi David,

Does your group have any web maps in it?

Can you post your config file and I'll see if I can diagnose the problem.

Thanks


The same thing is happening with my template.  I've been working with it for two nights.  If I may, I am posting my config files as well.  Please and thanks.
0 Kudos
BillEveringham
Deactivated User
I have a few map services that I enabled security on in ArcGIS server, but they won't allow me to view them in the gallery.  The funny thing is, it works on my ios device and not the pc.  Any suggestions on what the cause could be?

http://gis.arlingtonva.us/gallery/map.html?webmap=18a91293312d4d80aaef321bb361a40e

[ATTACH=CONFIG]15210[/ATTACH]
0 Kudos
MattDriscoll
Esri Contributor
I have a few map services that I enabled security on in ArcGIS server, but they won't allow me to view them in the gallery.  The funny thing is, it works on my ios device and not the pc.  Any suggestions on what the cause could be?

http://gis.arlingtonva.us/gallery/map.html?webmap=18a91293312d4d80aaef321bb361a40e

[ATTACH=CONFIG]15210[/ATTACH]


Hey Bill,

It might be something with the identity manager. Can you try changing the API URL in the html documents to use 2.8? That might do the trick. I would say 3.0 but I think 3.0 requires some more tweaks to get to work. I see it's using 2.7 right now. Maybe that will fix the issue of logging in.
0 Kudos
MattDriscoll
Esri Contributor
This template has been updated as an official template. It can be configured from the share button on a group's page or downloaded here: http://www.arcgis.com/home/item.html?id=34505d89a3b34be09b65b98938974390
0 Kudos