Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consume custom basemaps from agol organization account #151

Closed
kcarrier opened this issue Aug 12, 2014 · 8 comments
Closed

Consume custom basemaps from agol organization account #151

kcarrier opened this issue Aug 12, 2014 · 8 comments

Comments

@kcarrier
Copy link

Is there a way to configure basemaps.js to load available basemaps from an agol organizational account?

@tmcgee
Copy link
Member

tmcgee commented Aug 12, 2014

@kcarrier, I won't say No because I'm not completely sure. ;) A few questions come to mind to explore this further:

For the basemaps within your organization that you want to add, they AGOL Web Maps (not applications)? If they are web maps, where does the data for those maps reside? Are those web maps secured so only users within your organizational account can access them or are you sharing them publically?

@DavidSpriggs
Copy link
Member

@kcarrier Hey, long time no her! Glad you're still in the game! Yes you can do this. The docs talk about setting a basemapsGroup key that points at your group that contains your basemaps:
https://developers.arcgis.com/javascript/jsapi/basemapgallery-amd.html#basemapgallery1
If it's on on premis portal you will also need to set the portalUrl prop.

@kcarrier
Copy link
Author

@DavidSpriggs Yes it has been a long time been working a lot in python but yes I am back. Been trying to work with AGOL templates none of which have the flexibility or functionality this template provides or offers. So in looking over the example I think I have it right but I am thinking I need to do something more in basemaps.js.maps.

basemaps.js

https://gist.github.com/kcarrier/2b6f5a64dc6fba78959c

Would I need to do something to the basemaps.js.maps after this?

@tmcgee - The data for the maps comes from our AMI. We were lacking some functionality like being able to zoom in beyond the Esri/WMAS threshold, Esri helped us in getting our basemaps setup in AGOL so the LODS go in beyond the normal levels. Therefore our basemaps go in 2 scales beyond the 1128 scale. Now I am just trying to consume them in the template. I think the code in basemaps.js is right but I am thinking I might need something else in basemaps.js.map, just not sure yet.

Any advice would be greatly appreciated.

@DavidSpriggs
Copy link
Member

@kcarrier You can disregard the .map files, they are called source maps and are used by developer tools to translate built code into something readable in dev tools. So this is all done automatically for you based off the source file, all you need to do is edit the source and then build.

I made some comments on your gist.

@kcarrier
Copy link
Author

@DavidSpriggs - I have tried multiple ways of implementing this. I removed some of the references to the default AGO basemaps and tried implementing basemapGallery in this latest gist, still not sure what I am missing. I tried this on the developer site using a sandbox example but it is slightly different with some of the customization. Any thought on how to incorporate this into your template. My thought was if I included the basemapGallery function within the basemaps function and providing the function or return an alias I could use that in the basemapToShow arrary and then list the specific mapStartBasemap using the name of one of the basemaps in my gallery. Thoughts?

https://gist.github.com/kcarrier/66a77ec217f974fbe47e

FYI, this is the error I am receiving
Unhandled exception at line 8, column 152 in http://js.arcgis.com/3.10/js/esri/dijit/BasemapGallery.js

0x800a138f - JavaScript runtime error: Unable to get property 'id' of undefined or null reference

@DavidSpriggs
Copy link
Member

I think you will get the best results if you make a completely new basemap widget instead of using the existing one. Basically wrap the out of the box widget with a module that the template loads. I can put up a git for this latter tonight.

@friendde
Copy link
Contributor

@kcarrier did you find a solution? If so can you share a gist? Thx

@kcarrier
Copy link
Author

No I chose to go a different route, in my opinion AGOL handles basemaps differently than the ArcGIS API for JavaScript. In my opinion in JS it is much cleaner and smoother. Someone at Esri created the basemaps for me in AGOL with extra LODS defined but to the best of my knowledge you have to use a service with those extra LODS, they are currently unable to define the LODS in JSON when creating the custom basemaps. I also found flickering and choppy transitions when zooming in and out. This can be overcome in JS by setting navigationMode: 'classic' when defining the map. So given the enhancement opportunities that AGOL faces I felt using the REST endpoints and mashing up the maps, and being able to define the LODS in JS proved to be a better method than using the AGOL organization basemaps which are simply not as smooth as defining them in JS using the methods described above. I have been told that Esri is working on a tool to expose some of this functionality to organization accounts but it is still in development. I think once this tool is released it might prove beneficial to this template but for now in my opinion it is best to close this issue until this functionality is released publicly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants