by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • May 26 19:38
    sgavathe starred cmv/cmv-contrib-widgets
  • May 23 19:04
    tmcgee closed #948
  • May 23 19:04
    tmcgee milestoned #948
  • May 21 05:40
    snyk-bot opened #948
  • May 19 16:17
    tmcgee milestoned #946
  • May 19 16:17
    tmcgee milestoned #947
  • May 19 16:17
    tmcgee closed #947
  • May 19 05:40
    snyk-bot opened #947
  • May 18 20:19
    tmcgee closed #946
  • May 18 20:18
    tmcgee opened #946
  • May 17 19:26
    tmcgee milestoned #945
  • May 17 19:25
    tmcgee milestoned #944
  • May 17 19:25
    tmcgee closed #944
  • May 17 19:20
    tmcgee synchronize #944
  • May 17 19:20
    tmcgee closed #945
  • May 17 19:17
    greenkeeper[bot] opened #945
  • May 17 19:16
    snyk-bot opened #944
  • May 17 19:14
    greenkeeper[bot] closed #943
  • May 17 07:30
    greenkeeper[bot] labeled #943
  • May 17 07:30
    greenkeeper[bot] opened #943
Tim McGee
@tmcgee
@triesco Is your legend widget in a titlePane?
triesco
@triesco
yes sir, the default one.
Tim McGee
@tmcgee
//  get the titlePane for the legend, be sure to include `dijit/registry` in your declare statement
var titlePane = registry.byId('legend_parent');
// open the titlePane
titlePane.set('open', true);
@triesco :point_up:
marillenkrapfen
@marillenkrapfen
I would like to make the title of my CMV app dynamic, pulling a short text from a REST API service. Can someone tell me where I would insert a script that could fetch that information on init when the app loads? Would something like that work if I put it in the _LayoutMixin.js?
Tim McGee
@tmcgee
@marillenkrapfen It is certainly very possible to do something like that. I would suggest NOT putting it _LayoutMixin.js. Instead, I would create a separate mixin or a widget.
marillenkrapfen
@marillenkrapfen
@tmcgee Thank you -- I just don't know how to call it on load. Maybe I could put it in the script of index.html?
Tim McGee
@tmcgee
@marillenkrapfen This definitely can be done with JavaScript file loaded from index.html or a JavaScript function in the index.html file. A separate file might make it more portable for additional applications - depends on your needs.
marillenkrapfen
@marillenkrapfen
@tmcgee I'll give it a try -- I know it's a simple thing. Just wasn't sure where to insert it or how to start. Got a couple of ideas I will try. Thanks again.
milenaAE
@milenaAE
I am new to this site and to CMV customization. I have a question, does anyone knows if it is possible to insert user login and IP address watermarks on prints on from a secured portal Server/CMV application on cloud deployment.
Tim McGee
@tmcgee

@milenaAE If I am understanding your objective correctly the yes, I believe that would be quite possible. I think you'd need to start with a custom Print template and/or Print service on the AGS server that would accept the desired text. It may be possible to capture the info also within your service - not sure about that. If not, then on the client side you 'd possibly use a custom widget that would gather the data you want to include on the watermark, perhaps a variant of the CMV Print widget. To be more secure, you may want to capture the info using a server-side language like ASP.NET, PHP, etc. Perhaps your secured portal already handles some of that.

Another possibly approach would be to create a service proxy that sits in front of the Print Service that captures the info that you require and passes it along to the service.

Probably quite a few other possible approaches but bottom line is it is possible.

yogeshsharma505
@yogeshsharma505
Do we have RTL facility for Arabic
Tim McGee
@tmcgee

@yogeshsharma505 Yes, The Arabic language and RTL are supported by the Esri JavaScript API:. The API documentation is here

The Esri map and widgets used in CMV like Scalebar, Measurements and Legend already include localization for Arabic and the other languages shown on that page. The widgets developed by the CMV team have been localized with community support to French, Spanish and Portuguese. These localizations are also included in the Locale widget.

I would be happy to assist you or anyone with any efforts to translate CMV to Arabic or other languages. Let me know if I can help.

Tim McGee
@tmcgee
image.png
@yogeshsharma505 You can use the demo site to demonstrate how well Esri + CMV already support your local Arabic dialect by adding ?locale= to the url. Here is an example using Egyptian Arabic.
Tim McGee
@tmcgee
@yogeshsharma505 These widgets included with CMV should already have good locale support for Arabic:
  • Bookmarks
  • Directions
  • Editor
  • Home Button
  • Legend
  • Locate Button
  • Measure
  • Overview Map
  • Scalebar
  • Search
yogeshsharma505
@yogeshsharma505
CMV is really very useful and time saving ..my requirement is i want to change complete layout to RTL like widgets should come in right side and map is left side...Thanks in advance
@tmcgee Thanks for ur reply really it very useful
Tim McGee
@tmcgee

@yogeshsharma505 You can easily move the widgets to the right side of the page. Here's a copy of the demo site's viewer.js with a pane on the right side holding all the widgets.

The only changes are configuring a right pane while hiding the default left pane in panes section and then configuring each widget to be in the right pane.

yogeshsharma505
@yogeshsharma505
@tmcgee Thanks for your help we are working on that.we will come back to you for more help...Thanks
Robert Jones
@rjones0
I have a question about compatibility, which I have a feeling might be a silly question, but nonetheless since I couldn't find this information anywhere: is CMV compatible with ArcGIS Server 10.4.1? I am guessing the answer is yes, because CMV talks to Server via the REST API, and CMV is compatible with the REST API going back possibly to the inception of the REST API i.e. 10.1 or possibly even earlier. Grateful for clarification. Thanks
yogeshsharma505
@yogeshsharma505
Can we implement 3D as well?
Tim McGee
@tmcgee
@rjones0 I have multiple customers that are using CMV with AGS version 10.3.1 without issue (upgrading soon). Theoretically, CMV and the ArcGIS Javascript API is compatible back to AGS version 10.1 . Some of the Esri sample servers are still running 10.1! Those servers have some compatibility issues with modern browsers around security but nothing specific to the ArcGIS Javascript API or CMV that I am aware of.
Tim McGee
@tmcgee
@yogeshsharma505 The current version of CMV hosted on GitHub works with version 3.x of the ArcGIS Javascript API. That version of the API does not support 3-D. I have a version of CMV that works with version 4.x, including 3-D. However, that version is not available on GitHub. I've stopped guessing when I might release that version beyond a few of my existing customers who supported that effort. Working with the current CMV and supporting my customers has kept me very busy these past few years.
Robert Jones
@rjones0
@tmcgee many thanks! Exactly what I needed
ivo silvestre
@ivomts

Hi!

I’m trying to use cmv's find.js to query related records. I wonder if you can give me some advices?

Basically, I’ve a rest MapServer serving a Feature Layer related to a Table Layer.
What I need to do is to find a feature in the Table Layer, return some fields into the grid columns and zoom to the correspondent element in the Feature Layer.

{
description: 'test',
url: 'http://myserver/arcgis/rest/services/test/MapServer/',
layerIds: [4],
relatedTableId: 14,
searchFields: ["relationships/0/serie"],
minChars: 2,
gridColumns: [
{ field: 'snno', label: 'snno', width: 100, sortable: false, resizable: false },
{ field: 'u_mcons', label: 'u_mcons' },
{ field: 'serie', label: 'Nr serie' }
],
sort: [
{
attribute: 'u_mcons',
descending: false
}
],
prompt: 'p.e. "123456"',
selectionMode: 'single'
}

Thanks in advance.

Tim McGee
@tmcgee
@ivomts Are you asking about my Search widget? If so, there is an example that includes searching related records here
yogeshsharma505
@yogeshsharma505
@tmcgee Hi really appreciated .. Actually in my current project i need to deal with 2D as well as 3D so it will be great if you provide me solution using AGS JS 4.X version.Thanks in advance
ivo silvestre
@ivomts
@tmcgee Can I instead search for related records directlly using the queries parameters inside find.js?
Tim McGee
@tmcgee
@ivomts I think you are trying to use the Find widget. It uses the find operation of a Map Service. I am fairly certain that does not support related records.
yogeshsharma505
@yogeshsharma505
@tmcgee Thanks I understood due to some technical things we can not use 4.X for both 2D & 3D as of now but after some time we can.
ashishgis
@ashishgis
@tmcgee How to add and remove widget dynamically in cmv app
@tmcgee Please suggest solution, Thank in advance
Tim McGee
@tmcgee
@ashishgis you can load a widget at any time by publishing a topic. Removing widgets is a bit more problematic because of the dojo code needed to completely clean up the widget. I usually just show and hide widgets using CSS or other methods. If you use preload in the config effectively, the widget does not actually load until you want to show it. For example, by default a widget is not loaded until the TitlePane (or ContainerPane) that contains the widget is opened.
ashishgis
@ashishgis
@tmcgee Thank u
p0
How to change in viewer file, if it's possible so please provide any example for this query
Tim McGee
@tmcgee
@ashishgis I have never used the method referenced of publishing a topic so do not have an example. The majority of widgets in the demo viewer.js use the method I described with preload since it is set to false by default. The identify widget is the only TitlePane widget in the demo that preloads before its TitlePane is opened.
ashishgis
@ashishgis
@tmcgee Thank u so much sir
yogeshsharma505
@yogeshsharma505
@tmcgee Hi I want to open a web form on widget click please provide me steps.Thanks in advance
ivo silvestre
@ivomts

@tmcgee yes, Find operation does not support related records...
I didn't know how to use your Search widget inside my cmv, so I start to work in other way: query my SQL Server stand alone table and zoom the result using an auxiliar field with x,y coordinates. But now I know that it also doesn't support stand alone tables...

Maybe using your Search widget inside the search tab (is what I want instead of using Attributes Tables) is more easy to implement.
Is there anyone with the similar issue?
Thanks!

ashishgis
@ashishgis
@tmcgee Hello, How to wcf service use in viewer page? Pls provide any example of this query. Thanks in advance
Tim McGee
@tmcgee
@ashishgis I don't know of any examples that do this. If I am understanding your question correctly, I assume you'd have to do something like query the WCF Service to retrieve the data and load that into a Feature Layer or Graphics Layer.
@ivomts My Search widget supports the Find operation as well as Query operation including Related Records and standalone Tables that are published as part of a Map Service.
Tess Oldemeyer
@TOldemeyer_gitlab
Can a dynamic sublayer be configured to use ‘Zoom to Layer’ as a subLayerMenu option in layerControl?
Tim McGee
@tmcgee

@TOldemeyer_gitlab You can create a new custom widget using this one as a starting point. It has the basics for querying a sublayer - in this case, to get metadata. (You can simplify the code greatly since that example does more than you need). You would do a similar query to get the complete extent for all features in the layer. A query that ends up something like this:

https://sampleserver6.arcgisonline.com/arcgis/rest/services/SF311/MapServer/0/query?where=1%3D1&returnExtentOnly=true&f=json

which returns this:

{
    "extent": {
        "xmin": -122.51129560300001,
        "ymin": 33.75,
        "xmax": -108.60000000000002,
        "ymax": 38.100000000000023,
        "spatialReference": {
            "wkid": 4326,
            "latestWkid": 4326
        }
    }
}

As part of your query, you'll want to reproject the coordinates into the spatial reference used by your map (usually Web Mercator, WKID 102100).

Here's a code snippet for adding the menu for the sublayers.

Hoping this is enough to get you going.

abbas beigy
@abbasbeigy
We are waiting for the update🙂🙂🙂. https://files.gitter.im/cmv/cmv-app/JLbo/image.png
Tess Oldemeyer
@TOldemeyer_gitlab
Thanks to @tmcgee, this code is working to zoom to a dynamic sublayer from the subLayerMenu:
        SublayerZoomTo:{
            include: true,
            type: 'invisible',
            id: 'SublayerZoomTo',
            path: 'dijit/_WidgetBase',
            options: {
                map: true,

                startup: function() {

                    topic.subscribe('layerControl/SublayerZoomTo', lang.hitch(this, '_fetchExtent'));
                },
                _fetchExtent: function (event) {

                    var url  = event.layer.url + '/' + event.subLayer.id + '/query?where=1%3D1&returnExtentOnly=true&outSR=' + this.map.spatialReference.wkid + '&f=json';
                    new Request({
                        url: url,
                        content: {
                            f: 'json',
                        }
                    })
                        .then(lang.hitch(this, function (result) {
                            if (result && result.extent) {
                                var extent = new Extent(result.extent);
                                this.map.setExtent(extent, true);
                            }
                        }))
                        .otherwise(lang.hitch(this, function (error) {
                            topic.publish('viewer/handleError', {
                                source: '_WidgetBase.SublayerZoomTo',
                                error: error
                            });
                        }));
                },
               _handleError: function(e) {
                   this._fetchExtent({
                       id: e,
                       name: 'Error',
                       description: 'The query could not execute.'
                   });
               }
            },
        },
                    subLayerMenu: {
                        dynamic: [{
                            topic: 'SublayerZoomTo',
                            iconClass: 'fas fa-fw fa-search',
                            label: 'Zoom to Layer'
                        }]
                    },
Tim McGee
@tmcgee
:thumbsup:
ERS-Long
@ERS-Long
@TOldemeyer_gitlab Thanks for sharing this code. Just want to point out couple of things if others are going to implement it. 1) that Request is ESRI request, not dojo Request. 2) for secured map service, a proxy prefix url is needed.