Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Tim McGee
@tmcgee
@gisfinder That is correct. The various JavaScript libraries are not included in the cmv-calcite-maps example. You can copy them locally, host them on a CDN or place them wherever you'd like. Then you can adjust the locations within the packages array of app.js accordingly.
Ian Shiland
@ishiland
Can a layerGroup be set to expanded by default?
Tim McGee
@tmcgee
@ishiland good question. I don't think that is possible at present though a good option to consider if not there today
I am on mobile so can't check the code today
Ian Shiland
@ishiland
great, thanks. Not a high priority
gisfinder
@gisfinder
in calcitemap, where is the function of click menu item of sidebar? I want to load data into "Show Tables".
gisfinder
@gisfinder
I get it for the above question. It is in "_CalciteMixin.js" , the function is "_createBootstrapWidget".
gisfinder
@gisfinder
@tmcgee I want to load data into "Show Tables" after click the menu item is clicked. So I do not need the title widget window in the right part. How to set config to create widget? Then I can write code for loading data in the widget.
abbas beigy
@abbasbeigy
@tmcgee HI. When will this update be released?
kjohnsonGIS
@kjohnsonGIS

Hi All, I recently discovered using the cacheBust property in the dojo config makes requests fail to https://epsg.io/ (street view widget) because cachebust appends a query string to each request and epsg.io doesn't like that. My temporary solution was to add a ? to the request in the street view widget (getStreetView function)
see below

    var key = this.proj4Catalog + ':' + String(wkid);
    if (!proj4.defs[key]) {
        var url = this.proj4CustomURL || this.proj4BaseURL + String(wkid) + '.js?';  //added question mark for cachebust.   cachebust appends version number to url like &1.0.0 and https://epsg.io does not like this!  kj 12/30/2019
        require([url], lang.hitch(this, 'getStreetView', evt, true));
        return;
    }

Another idea was to use the hostRedirect property in the proxy config since I am proxying this request but that didn't work. not sure why. Anyone else come across this or have any ideas?
Thanks and Happy New Years

Tim McGee
@tmcgee

@island Are you using the full version of the Esri API (like https://js.arcgis.com/3.31/)or the compact version (like https://js.arcgis.com/3.31compact/)? And also which version of the API? Compact has been the default for CMV for years but I have been considering changing that. I've noticed that cacheBust appears to have been broken in the compact version at v3.22. Whatever is going on there may have led to other undesirable effects as well.

The cacheBust property can be used a couple of different ways and there are various methods to have it ignored. How exactly are you using it?

kjohnsonGIS
@kjohnsonGIS
Hi @tmcgee im using the compact version like this "arcgis_js_api/library/3.21/3.21compact/init.js" (self hosted) and putting cacheBust in the app.js dojoConfig like this:
    window.dojoConfig = {
        locale:'en-us',
        async: true,
        packages: [
            {
                name: 'viewer',
                location: path + 'js/viewer'
            }, {
                name: 'gis',
                location: path + 'js/gis'
            }, {
                name: 'config',
                location: path + 'js/config'
            },{
                name: 'widgets',
                location: path + 'widgets'
            },{
                name: 'proj4js',
                location: path + 'resources'
            }, {
                name: 'flag-icon-css',
                location: path + 'resources'
            }
        ],
        cacheBust:'1.0.1'
    };
Tim McGee
@tmcgee
@kjohnsonGIS ok. that's the typical approach. And sorry for @ the wrong person in my previous response.
kjohnsonGIS
@kjohnsonGIS
Hey, no worries! it seems generally cacheBust is working for all other requests to js files, when i look in chromes dev tools network, i see all the files have the ?1.0.1 appended to them but for epsg.io request it ends up like https://epsg.io/102709.js&1.0.1 which it doesn't like but adding the ? fixes it
Tim McGee
@tmcgee
@kjohnsonGIS I'm not sure why it is adding & to the url instead of ?
That is the surprise to me
When I use cacheBust it adds ?1.01.
kjohnsonGIS
@kjohnsonGIS
yeah not sure.. maybe something with the require?
oh!
Tim McGee
@tmcgee
NOTE: in my test I am not using StreetView widget and so no calls to epsg.io
kjohnsonGIS
@kjohnsonGIS
oh ok, im only seeing the issue in the street view widget, no where else
Tim McGee
@tmcgee
espg.io is also used in the MapInfo widget
Can you try using cacheBust:'?1.0.1?
It will add ?? to most urls which should be fine. might result in &? for epsg.io which I guess would still break
kjohnsonGIS
@kjohnsonGIS
ok thanks, just tried that, but the url to epsg still got the & put in front, but wierdly for that request only one ?.. all the other requests have ??1.0.1
Tim McGee
@tmcgee

@kjohnsonGIS I think this might be a better fix specific to the StreetView widget and others that use epsg.io:

var key = this.proj4Catalog + ':' + String(wkid);
if (!proj4.defs[key]) {
    var url = this.proj4CustomURL || this.proj4BaseURL + String(wkid) + '.js';
    require({cacheBust: false}, [url], lang.hitch(this, 'getStreetView', evt, true));
    return;
}

NOTE the additional first parameter sent to require()

kjohnsonGIS
@kjohnsonGIS
oh ok Nice!!
Tim McGee
@tmcgee
no. not so nice it appears.
it stops adding the 1.0.1 parameter from that point forward for all requests.
kjohnsonGIS
@kjohnsonGIS
oh, yeah thats not good
Tim McGee
@tmcgee
@kjohnsonGIS I have tried a few other ideas and your original approach is better than any of them.
Tim McGee
@tmcgee

@kjohnsonGIS : Capturing for future reference but maybe you can test to be sure.

This appears to work when placed in index.html(not app.js). With this additional function, the cacheBust property is not required.

window.dojoConfig = {
    locale: locale,
    async: true,
    fixupUrl: function (url) {
        return url + '?1.0.1';
    }
};

This function is supported in dojo but not well documented.

Tim McGee
@tmcgee
@kjohnsonGIS Are you using a proxy or anything else that might be including a ? somewhere else in the url? That's one way to accidentally break the dojo code for using the cacheBust property and the only reason I can see why it would add & instead of ?. The function above circumvents that check but still imperfect.
kjohnsonGIS
@kjohnsonGIS
@tmcgee thanks for all your help! I'll try adding that function in the index.html dojoConfig and let you know. I am using esri's proxy app for that epsg.io url.
i think your right that that's causing the problem. Other urls that I'm proxying work fine, but maybe because when something is appended to the url in other cases, its actually adding parameters?
Tim McGee
@tmcgee

that's likely the problem then - a compatibility issue with the Esri proxy and cacheBust parameter that confuses espg.io (and potentially other urls that you do not happen to be accessing)

You might want to consider changing your configuration so the esri proxy is only used for certain domains and not others (like epsg.io). That can be done in viewer.js using esri/urlUtils. That's generally a good idea overall though I also recognize that it may not be possible /practical in your implementation.

kjohnsonGIS
@kjohnsonGIS
ok thanks, yeah we have to keep all browser requests within our system, but maybe i can self host that epsg file.. it looks pretty small!
Tim McGee
@tmcgee
I was going to recommend that self-hosted approach. That would definitely solve your issue.
kjohnsonGIS
@kjohnsonGIS
:thumbsup: Happy New Years! cmv is an amazing application!
ERS-Long
@ERS-Long
Can’t agree more, patiently waiting for the version for js api 4.x. (:)) Happy New Year to All!
Tim McGee
@tmcgee
Happy New Year to all CMV-ers everywhere. It brings me such great joy that CMV continues to provide much value and benefit to you all. Cheers to many interesting and exciting years ahead for the CMV community.
mayur9785
@mayur9785
Happy new year to all!
absolutely CMV is an amazing application!
gisfinder
@gisfinder
Happy new year , the guys using CMV.
triesco
@triesco
Any plans for cmv to work with arcgis js 4.x ??
Steve
@cuthberts
Is there a way to make the template picker of the Editor widget more then 3 columns wide? Perhaps set to auto depending on how big i make the widget frame?
Santiago Utsumi
@santiagoutsumi
Hi somebody there to help with the following
I use GitHub to make a custom web map using QGIS2Web that worked fine but now would like to visualise atribute tables for selected lyears and then to export tables as CVS file. Any help welcome. I am not a codeing guy....
Tim McGee
@tmcgee
@triesco Yes I have worked on several approaches for including the v4.x API in CMV: 1) dojo-based like we do with v3 (CMV supporting both 3 and 4) and 2) components for use React (v4x only). Both of these have been in use by several of my clients for quite awhile. Consistent with my past efforts, both were created using funding from the client for their projects with the specific intent that the work on CMV will ultimately be released as open source for use by all CMV users and developers. It is taking much longer to get that public release than I had wished but it will occur. I hesitate to provide any time frame for the release because I have said coming soon several times in the past and have been wrong so I won't say it now. Sorry I can't be more specific at this time.
Tim McGee
@tmcgee
@cuthberts Esri's Template Picker widget includes parameters for the number of columns and rows. I have used them successfully in custom widgets I have built. I am pretty sure you can pass those parameters along with the Esri Editor widget and you'd need to create your own widget. This is something I always recommend for editing because the Esri Editor widget doesn't provide acceptable flexibility of the Editing experience for the users or the developers.
Tim McGee
@tmcgee
@santiagoutsumi Your project is using Leaflet not the Esri JavaScript API. The Attributes Table widget is dependent on the Esri API so may be very difficult to integrate into your project. I suggest you look for a different components that will work with Leaflet.