tmcgee / cmv-widgets Goto Github PK
View Code? Open in Web Editor NEWWidgets for CMV, the Configurable Map Viewer.
Home Page: https://cmv.io/
License: MIT License
Widgets for CMV, the Configurable Map Viewer.
Home Page: https://cmv.io/
License: MIT License
@tmcgee - What is the best way to implement multiple drop downs.
Should I create different versions of the same widgets or if there a way to specify multiple drop down downs within the same widget?
Hi Tim. I am trying to get your Search widget with related tables working. I managed to get the search working with my properties dynamic layer and it opens the table. I also have setup the relationship part of it (using your -relatedRecords.js). It opens the related table, however, it returns the incorrect entries according to how the relationship is setup. It then also zooms to a totally difference feature when I click on the related table record (the related table has no shape).
Do I need to setup anything specifically in the relationship part of the code or is everything handled in the relationship in the service?
These are MXD relates and not GDB relationship classes (if that makes a difference).
I should have this on our test server if you need to check it out.
Thanks.
Hi,
Is there a way to configure the search widget to search multiple layers for the same information? (multiple sublayerIDs or multiple urls that include the layerindex)
Thanks,
Ally
Editing, moving, and deleting the points all show up back in my feature service MXD, so that's great. What I want to know how to do is have the API automatically write the X,Y/Lat/Long/coordinates of a point to the attribute table of my feature service. So for example when the Editor template is used to add a new point to the web map, have the script write the location of the point to the table. If the point is moved, update the table to reflect that new location. I've played with the map.on("mouse-move", showCoordinatesFunction) so that I can see the current position of my mouse cursor, but I need help getting that written to the table.
I would like my attribute table to be open when the map loads and display a list of the features included in the operational layer I have already added to my map.
My first approach to this was to include this operational layer with a "1=1" query as a table to the list of tables to be loaded when the widget is first instantiated. This did accomplish the desired functionality of opening the table when the map loads, but duplicate graphics were appearing on the map. This is a points layer, so the first set of graphics are symbolized as programmed into the MapService. The second set of graphics are the purple round marker symbols--default for search results.
I next tried changing the query type from 'spatial' to 'table' thinking that this would populate the table only, but not add a duplicate layer to the map. Still no luck.
Is this functionality currently supported? Thanks for your help!
When using the Export widget, passing a FeatureSet, I see that the fields are hidden in Excel. I say "hidden" because the Excel column headers don't start at A, they take into account the columns that were passed. I'm not sure if this is an existing bug, or specific to the FeatureSet. The code appears to be setting "hidden: false", so more investigation is needed.
Is it possible now to set CMV layers to be available in the attribute table via the layerControl widget or is it still in the planning stages?
When specifying multiple query tables (tabs) in the viewer.js two "Searching... please wait messages" appear when the CMV is launched. One of the searching messages will disappear right away, but the second stays until the timeout is reached. I thought about flagging it with a boolean or counter to keep it showing up twice, but I wanted to make sure this isn't operator error. Thank you.
attributesTable: {
include: true,
id: 'attributesContainer',
type: 'domNode',
srcNodeRef: 'attributesContainer',
path: 'gis/dijit/AttributesTable',
options: {
map: true,
mapClickMode: true,
// use a tab container for multiple tables or
// show only a single table
useTabs: true,
// used to open the sidebar after a query has completed
sidebarID: 'sidebarBottom',
// optional tables to load when the widget is first instantiated
tables: [
{
title: 'Boil Water Notifications',
topicID: 'notificationQuery',
queryOptions: {
queryParameters: {
url: 'http://<mysvr>/gis/rest/services/Notifications/MapServer/0',
maxAllowableOffset: 100
//where: 'NOTIFICATION_STATUS = ACT'
},
idProperty: 'ObjectID'
}
},
{
title: 'Bagged Fire Hydrants',
topicID: 'bhQuery',
queryOptions: {
queryParameters: {
url: 'http://<mysvr>/gis/rest/services/Bagged_Hydrants/MapServer/0',
maxAllowableOffset: 100
//where: 'NOTIFICATION_STATUS = ACT'
},
idProperty: 'ObjectID'
}
}
] //end tables
} //end of options
}
Hello,
I was wondering how to add extra node next to your grid node,
On click user would view attachments in that node
Thank you,
I'm having difficultly defining which attributes show up as columns in the attributesTable widget. This is what I have which doesn't work:
attributesTable: {
include: true,
id: 'attributesContainer',
type: 'domNode',
srcNodeRef: 'attributesContainer',
path: 'gis/dijit/AttributesTable',
options: {
map: true,
mapClickMode: true,
// use a tab container for multiple tables or
// show only a single table
useTabs: true,
// used to open the sidebar after a query has completed
sidebarID: 'sidebarBottom',
// optional tables to load when the widget is first instantiated
tables: [],
},
gridOptions: {
columns: [
{ label: 'Section ID', field: 'SectionID'},
{ label: 'Street Name', field: 'FullStreetName' },
{ label: 'Begin Point', field: 'BeginPoint' },
{ label: 'End Point', field: 'EndPoint' },
],
},
}
Thanks!
I am not sure why, but if I set pagination to false in the grid options, the grid displays only a header and the data rows are missing.
Has anybody encountered this and found the solution?
Thank you!
Hello Tim
I like your tools so much
You put on your Clear button in the attribute table
Clear All Features,
clear selected feature,
clear grid,
clear all,
are you able to add clear selected tool example here: we just clear the Rectangle
or explain to me how to change the select tool with color transparent that will continue to work where I can change that
On Print button click unable to print the Map ...Eventhough print tool Url created in 10.2 unable to Print the map..It is showing the error as "Error ,Try again"
I have included several Zoom To widgets in my app and they perform as expected except for where objectid = 1, the initial record. Nothing happens when I click the top record in the pick list.
Just wondering if this is a bug and if so is there a fix or workaround?
Or, is there something I'm missing in the config?
I am seeing this behavior in the demo app as well.
Many thanks,
PW
In other words, if I'm using Search to open AttributeTables, can I specify an infoTemplate to be used?
It looks like _GraphicsMixin will set the infoTemplate:
_GraphicsMixin
However, it's not real clear where you configure the infoTemplate, especially when using Search in conjunction with AttributeTables.
Thanks!
Just as the title says, I cannot get my Attribute table to format one of my fields as a date. if no columns are defined under gridOptions, the field is automatically shown as date, but when defined, I get an error message "Uncaught ReferenceError: formatDateTime is not defined".
My code looks like this:
gridOptions: {
columns:[
{ label: 'Section ID', field: 'SectionID', width: 100,},
{ label: 'Street Name', field: 'FullStreetName', width: 170, },
{ label: 'Begin Point', field: 'BeginPoint', width: 170, },
{ label: 'End Point', field: 'EndPoint', width: 170, },
{ label: 'Surface Condition Rating', field: 'SurfaceConRating', width: 100, },
{ label: 'Drainage Rating', field: 'DrainageRating', width: 150, },
{ label: 'Evaluated', field: 'EvalDate', width: 150, get: function (object) { // allow export as a proper date
return new Date(object.EvalDate);
},
formatter: formatDateTime},
{ label: 'Evaluated By', field: 'EvalBy', width: 100, },
],
},
Any suggestions?
Hi, Tim:
I am trying to implement the functionality to open attribute table from sublayer, here is my code
topic.subscribe('LayerControl/openAttributeTable', function (r) {
console.log(r.layer.url); //layer id
console.log(r.subLayer.id); //array of set visible layer ids
var data_list = [
{
title: 'AttributesTable',
topicID: 'AttributesTable',
queryOptions: {
queryParameters: {
url: r.layer.url + '/' + r.subLayer.id,
maxAllowableOffset: 100,
where: '1=1'
},
idProperty: 'ObjectID'
}
}
];
console.log(data_list);
this.addTables(data_list);
//this.tables = data_list;
});
I put the above code in your AttributesTable.js file's postCreate method, but somehow i got this error
Uncaught TypeError: this.addTables is not a function
Please let know if you have some suggestion on this.
Thanks a lot!
The highlighted graphics from a search are not being unhighlighted in IE 10 and 11 on Windows 7, 8 and 10 and also in the new Microsoft Edge.Line 239 adds the mouse-out event to the graphics, but the unhighlightGraphic function never fires in IE on line 517.
Hello TIM
i am still stock with Silver light for that function: Query in silverlight? You are able to select the airports BY ATTRIBUTE to create a new layer...on the map very cool!
EXAMPLE: STATE AOP FILTER, Select Aerodrome by state: here I select EGYPT and in the map content, its appear: STATE AOP FILTER with EGYPT AERODROMES, AND ALSO ON THE MAP I HAVE JUST THE AERODROME OF EGYPT...AND IN THE TABLE OF ATTRIBUTE...
Do you think its possible to do something like that or make that in an other way?
Many thanks again..for all your advised.
TypeError: this.clearQuery is not a function
this.clearQuery();
Table.js?1.3.3 (line 236, col 13)
This occurs when you try to close a tab.
Is there an example using a linked query to help understand how to use these configuration options?
Did anyone link the visibility of an attribute table's graphics with its corresponding layer from the Layer Control? This means that when the layer is not visible the attribute table's graphics should be hidden and so on. If not can you please guide me to the proper direction.
I am working on this and I think it would be a great adittion, I will come back here if I find anything.
Is it possible to sort attributes from a field alphanumerically?
Hey Tim,
I've been having issues getting this widget working when trying to replicate your demo of the Search Widget on my end. I can get the widget to pull up on the side panel, but there are not contents. I doubt I'm providing enough information on the issue, but do you have any idea on what could be causing the errors (see the attached snip).
Thanks for your time,
Jesse
Hello,
was interested in adding column with attachment links in the attribute table. Wonder is it possible to achieve this?
Thank you,
I'm implementing a renderCell
function in a gridOption
's column
definition like this:
gridOptions : {
columns : [
{
id : 'Documents',
field : 'EU',
label : 'Exp. Uni.',
width : 100,
sortable : false,
exportable : true,
renderCell : function(object, value, node) {
request("http://.../webservices/documents/123456789").then(function(data) {
// do something with handled data
node.innerHTML = '<i class=\'fa fa-search\' style=\'margin-left:8px;\'></i>';
}, function(err) {
// handle an error condition
});
}
}
(...)
...and I noticed that renderCell
is being called three times, even with 1 row of result. Consequently, my request is being made three times too. Any ideas about how to overcome this?
PS: I'm not sure if the issue is related with this widget (Search).
I try this morning the share this map…
In my mind I think when you zoom the widget retain the zoom IN THE LINK???
EXAMPLE: embed map don't retain the zoom
When you zoom to the Floride…
http://gis.icao.int/icaoviewernew/?extent=-83.199463,25.807166,-79.922791,27.583622#/-81.5433/26.8901/8
It will be very great that the link is able to retain the Zoom
Many thanks to you
Would there be any disadvantage to having the attribute table widget automatically determine which ID field to use (if it's not provided) by looking for esriFieldTypeOID
? It looks like the zoom to feature doesn't work correctly if no idProperty is provided.
Sorry if I've posted this in the wrong location. I'm attempting to modifying the AttributeTable widget to toggle the pane if no results are found. I was wondering if I could get some guidance on this or possibly submit it as an enhancement request.
Thank you,
Daniel
Hi,
I'm trying to incorporate the search, attribute table, and export widgets into my CMV app. I'm getting the following error when I try to search for "Widget uniqName_10, attrTab-attributesContainer":
Microsoft JScript runtime error: uniqName_10: parser returned unfilled promise (probably waiting for module auto-load), unsupported by _WidgetsInTemplateMixin. Must pre-load all supporting widgets before instantiation.
I can get it to work on Chrome sometimes usually with tabs set to false, but it always fails in IE8. I have switched to IE11 and it does work, but I still get errors when I run in the chrome dev tools or firefox, but it doesn't stop the tool from working like it did before. Can anyone help me? I'm not sure how to troubleshoot this or if I even should since the error isn't preventing the tool from working.
Thanks
Hello Tim
I just modified in the config/ zoomtofeature like that:
widgets: {
zoomToFeature: {
include: true,
id: 'zoomToFeature',
type: 'titlePane',
title: 'Zoom to A California County',
position: 0,
open: true,
path: 'widgets/ZoomToFeature',
options: {
map: true,
// you can customize the button text
i18n: {
selectFeature: "Select A County"
},
url: 'http://gis.icao.int/ArcGIS/rest/services/5lnc2016/MapServer/2',
field: 'NAME_CODE',
where: '1=1',
}
}
}
};
First question:the drop down appear but do not zoom?? what is wrong?
Second: where is the viewer.js in multiple line, like old example?
with software you use to convert one line to multiple line to insert all your modification in one viewer.js CMV...
How to put new layers in your super app?
Third: I don t understood your example: where: 'STATE_FIPS = '06' ',
where: 'Dist_NM < '761' ', i just want when the field Dist_NM is less than 761NM I DONT UNDERSTAND THE ' \ ' '?
I am working to included all your stuff in the CMV
i have on line; your search and the table attribute you developed
there is the zoom to screen shot: the drop down work but when you select an element the zoom function is not working...:
Thank for your great support you do for me...
I wonder how to check to see if row in the table has the related records before its renders, my try here:
https://gist.github.com/goriliukasbuxton/4a8c7a1687a57d640dd2
I've tried tracking this one down but haven't had any luck. I'm using the Search and AttributesTable widget together. The first time I execute a search, graphics are displayed no problem. Subsequent executions of the same search (with different values) also work just fine. If however, I close the tab with the search results between searches, the graphics are no longer displayed. Selecting a row will still zoom to the feature but the graphics, neither highlighted or selected are displayed.
Any ideas?
Hello everyone, I want to know if there's a way to reload an attribute table, I am using a query and the results are displayed in the table in the beginning, and I gave the user the ability to select some features then delete them. What I want to do is a "refresh or reload" to the table after the delete is complete. is it possible?
Hi
It seems there is a code error in ZoomToFeature widget, while setting the renderer for the polygongraphics layer. as shown below the if condition should check for polygonGraphics layer and not polylineGraphics layer.
if (symbols.polygon && this.polylineGraphics) {
polygonSymbol = new SimpleFillSymbol(symbols.polygon);
polygonRenderer = new SimpleRenderer(polygonSymbol);
polygonRenderer.label = 'Search Results (Polygons)';
polygonRenderer.description = 'Search Results (Polygons)';
this.polygonGraphics.setRenderer(polygonRenderer);
}
Please fix the same or let me know, if I can do it.
Warm Regards,
Thejus
Hello,
Wanted to make suggestion or even get some guidance in adding the filter table capability to the attribute table?
Thank you,
Wonderful your Search with Attribute and Shape work...great!
[http://gis.icao.int/cmv-widgets-master/demo.html?config=search2]
I try now to install the homeButton
homeButton: {
include: true,
id: 'homeButton',
type: 'domNode',
path: 'esri/dijit/HomeButton',
srcNodeRef: 'homeButton',
options: {
map: true,
extent: new Extent({
xmin: -180,
ymin: -85,
xmax: 180,
ymax: 85,
spatialReference: {
wkid: 4326
}
})
}
},
I copy that in the search2
and nothing work I try many things... no success ...
Do you have an idea?
Thanks again for your great tools
In the addGraphicsLayer function, I have reorder the load order of the graphics layers. We have noticed an issue especially with polygon shapes. The Source graphic is the top most graphic. this prevents the Feature graphics from being highlighted.
I have changed the load order to:
this.map.addLayer(this.sourceGraphics);
this.map.addLayer(this.bufferGraphics);
this.map.addLayer(this.featureGraphics);
this.map.addLayer(this.selectedGraphics);
list all the SDE datasets in one combobox
on change of that combo box we have to list all the featureclasses in that dataset in another combo box
on click of download we have to download that layer ?
Hi Tim,
When using the select 'By Shape' tab, how do I add more layers to the dropdown?
Thanks!
You see in your example a little pencil in the field Action (its for editing or I dream?)
it s help me to have the edit in the table because the people here like table (Edit in attribute they don t like! to complexes)
also I must stop the silver light services to switch to your template cmv and in silver light we have the possibilities to edit in the table on attribute directly
Hi, Tim:
Seems the export button does not work in IE 11, i tried your export widget example using IE
11.0.9600.18163
It works beautifully in Chrome, FireFox.
We have this one client that are somehow glued to IE.
Do you think there is a way to resolve this?
Thanks
In _GraphicsMixin on lines 289 and 290 there is no need for the PopupTemplate class. I believe this is handled by the underlying map.
Removing line 289 and changing 290 as follows correctly displays the configured infoTemplate on the search result graphic:
graphic.setInfoTemplate(this.infoTemplate);
This has been tested successfully in one of my applications.
I am trying to use the Disclaimer, but I'm finding it to unreliably load. I'd guess it's showing up maybe 30% of the time I load my map application. When it does not load, I see the following code in the console:
Uncaught Error: uniqName_5: parser returned unfilled promise (probably waiting for module auto-load), unsupported by _WidgetsInTemplateMixin. Must pre-load all supporting widgets before instantiation.
One of the operational layers I'm loading is a large aerial image, and I was thinking the lag experienced loading that layer was causing the Disclaimer not to load. However, even when I do not bring in that aerial layer, the problem still persists.
Thoughts? Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.