Esri / Viewer

Viewer is a configurable application template that enables you to display an ArcGIS web map using a variety of tools.
Apache License 2.0
60 stars 118 forks source link

Bitly link under "share" widget doesn't immediately appear #12

Closed gbonynge closed 10 years ago

gbonynge commented 10 years ago

After I first load this app and click on the "share" button, the bitly URL doesn't appear until I click on the "share current map extent" option. (I'd take a stab at fixing it myself, but I don't know where to start!)

jgravois commented 10 years ago

i tend to agree with you that we shouldn't wait for _useExtentChanged to go ahead and generate a bitly link.

if you want them to be created immediately, you just need to call the private function _shareLink() each time the url in the dialog is updated.

//near line 215 of ShareDialog.js (within the private updateUrl function)
this._shareLink();  // this is the line you need to add
// set url value
domAttr.set(this._shareMapUrlText, "value", url);  //existing code
domAttr.set(this._linkButton, "href", url); //existing code
jgravois commented 10 years ago

some feel URL shortners are better off avoided http://boingboing.net/2009/04/04/why-url-shorteners-s.html

kellyhutchins commented 10 years ago

@gbonynge we've fixed this issue and the update will appear in the next release.

gbonynge commented 10 years ago

@kellyhutchins sounds good, thank you!

@jgravois Point taken! Thanks for sharing the URL. I just learned about the bitly tools for tracking traffic to each of the shortened links that're created using a developer's unique bitly API key. I think they may be nice for getting an idea of what maps are used most frequently on my website, so I'm still leaning towards using them.

jgravois commented 10 years ago

@gbonynge i understand completely. thanks for taking the time to report the issue.

if you have any trouble following my instructions to correct the issue in your own app prior to the update, please check it out here. i'd be happy to help further if you have any more questions.

dcaviness commented 10 years ago

I like this template a lot and want to use it. However, what steps do I need to do to convert this template to use local map services, not an ArcGIS Online webmap? AGO webmaps are out of the question for this particular project.

I realize this might not be the best place to ask this question, but I haven't found a better place to ask.

kellyhutchins commented 10 years ago

@dcaviness its not a trivial task to convert this template to work with local services. You'd have to handle the work of adding the layers, defining the symbology, popups etc and pull out all the online specific logic that deals with the web map and app. One potential option, although its still quite a bit of work, would be to define a web map using json and use that with the template. Take a look at the Web map using JSON for an example of how this works. https://developers.arcgis.com/javascript/jssamples/ags_createwebmapitem.html And for details on the web map spec review the Web map help: http://resources.arcgis.com/en/help/arcgis-web-map-json/

You may also want to post this question to the geonet forums to see if anyone else has already tackled this work:

https://geonet.esri.com/community/developers/web-developers/arcgis-api-for-javascript

jgravois commented 10 years ago

@dcaviness opening a new issue probably would have been a little more appropriate, but no worries.

i'm not sure i understand the resistance to ArcGIS Online here, since it doesn't force you to actually publish any data in the cloud.

alternatively, you can use AGOL to author webmaps which solely reference ArcGIS Server services behind the firewall. in this instance, the urls themselves are all that are saved.