|
POST
|
OK, I think I have the right combination now. Fixing the versions of css and api combined with using an existing div, as opposed to creating a new one on the fly worked for me. app.Table = new FeatureTable({ featureLayer: app.pointFLayer, map: app.map}, 'gridDiv');
... View more
06-02-2016
06:56 AM
|
0
|
1
|
2496
|
|
POST
|
As I mentioned before, I've tried variations on this part of the definition, with a node or simply the id of the node and still no table, only parts of it seem to be getting created.
... View more
06-02-2016
06:49 AM
|
0
|
0
|
2496
|
|
POST
|
I actually tried it that way first, and it didn't work either. So I went back to Robert's syntax that did include .id. I can see that it is loading something, but I only seem to be getting the main grid container and some elements of the grid menu. I'm thinking it could be something as basic as an error in the field names. I keep paring those down, and maybe that's still where the problem lies.
... View more
06-02-2016
06:20 AM
|
0
|
1
|
2496
|
|
POST
|
I'm just not getting anywhere with this. This is public facing: FeatureTable Example It would be wonderful if someone could spot the likely dumb thing I'm missing.
... View more
06-01-2016
02:31 PM
|
0
|
2
|
4544
|
|
POST
|
Yeah, I know it's built on dGrid, but it's not identical syntax. It's just close enough to be confusing. I took the lines out for formatting the date, but it didn't help. Same error as before. I also changed my aliases to not have an underscore, although that's not traditionally a problem. I vaguely remember some issue mentioned specifically for a compact build that isn't in the full set. I switched from 3.16compact to 3.16, but that didn't change the error either. I hoped to get this figured out, because it more closely aligns with how tables look in WAB. I'm working toward a consistent look and feel.
... View more
05-20-2016
01:58 PM
|
0
|
0
|
4544
|
|
POST
|
I am using FeatureTable for the first time, attempting to use it instead of dGrid (just for fun, you know). My AGS server is still at 10.2.2. I'm using version 3.16 of the API. My featureLayer is defined as: app.pointFLayer = new FeatureLayer (pathName+"/arcgis/rest/services/DHSS/mysecure/LayerMapServer/0", {
id: "resFLayer",
outFields: ["*"],
opacity: 0.0
}); I have a load function on this layer to generate the table: //populate the table in the footer app.pointFLayer.on ("load", function (fl) {
myFeatureTable.initTable();
}); Here's that function: define([
"dojo/dom",
"esri/dijit/FeatureTable"
], function(dom, FeatureTable){
return {
initTable: function(){
app.Table = new FeatureTable({
featureLayer: app.pointFLayer,
map: app.map,
dateOptions: {
datePattern: 'MMMM d, y'
},
// outFields: ["Kit_Serial_Number", "Address", "City", "State", "Zip", "County", "Analysis_Date", "Final_Result", "Loc_Code"],
fieldInfos: [{
name: 'Kit_Serial_Number',
alias: 'Kit Serial Number'
}, {
name: 'Address',
alias: 'Address'
}, {
name: 'City',
alias: 'City'
}, {
name: 'State',
alias: 'State'
}, {
name: 'Zip',
alias: 'ZIP'
}, {
name: 'County',
alias: 'County'
}, {
name: 'Analysis_Date',
alias: 'Analysis Date'
}, {
name: 'Final_Result',
alias: 'Final Result'
}, {
name: 'Loc_Code',
alias: 'Location Code'
}]
}, dom.byId('tableDiv'));
app.Table.startup();
return app.Table;
}
}
}); There are a lot of points in this layer, over 20K. I know this isn't great, but it's what the users asked for. I'm going to add some query capabilities that will eventually limit the results to something more reasonable. In the meantime, this processes a while and eventually gives me this error: init.js:199 SyntaxError: Unexpected char ] in label.dgrid-hider-menu-label.hider-menu-label-0[for=[object HTMLDivElement]_grid-hider-menu-check-0](…) "SyntaxError: Unexpected char ] in label.dgrid-hider-menu-label.hider-menu-label-0[for=[object HTMLDivElement]_grid-hider-menu-check-0] at q (https://js.arcgis.com/3.16compact/put-selector/put.js:4:496) at r._renderHiderMenuEntry (https://js.arcgis.com/3.16compact/dgrid/extensions/ColumnHider.js:4:32) at r._renderHiderMenuEntries (https://js.arcgis.com/3.16compact/dgrid/extensions/ColumnHider.js:3:115) at r.renderHeader (https://js.arcgis.com/3.16compact/dgrid/extensions/ColumnHider.js:6:243) at m (https://js.arcgis.com/3.16compact/init.js:96:92) at A.renderHeader (https://js.arcgis.com/3.16compact/dgrid/extensions/ColumnResizer.js:6:363) at Object.h.around.advice (https://js.arcgis.com/3.16compact/init.js:234:254) at g.(anonymous function).h [as renderHeader] (https://js.arcgis.com/3.16compact/init.js:234:44) at h._updateColumns (https://js.arcgis.com/3.16compact/dgrid/Grid.js:13:215) at h._setColumns (https://js.arcgis.com/3.16compact/dgrid/Grid.js:12:340) ---------------------------------------- rejected at a (https://js.arcgis.com/3.16compact/init.js:190:337) at k (https://js.arcgis.com/3.16compact/init.js:190:89) at q (https://js.arcgis.com/3.16compact/init.js:189:357) at resolve (https://js.arcgis.com/3.16compact/init.js:191:441) at https://js.arcgis.com/3.16compact/esri/dijit/FeatureTable.js:22:50 at r._resolve (https://js.arcgis.com/3.16compact/esri/layers/FeatureLayer.js:159:236) at https://js.arcgis.com/3.16compact/esri/layers/FeatureLayer.js:162:498 at c (https://js.arcgis.com/3.16compact/init.js:66:221) at d (https://js.arcgis.com/3.16compact/init.js:66:10) at resolve.callback (https://js.arcgis.com/3.16compact/init.js:67:350) ---------------------------------------- Error at then.b.then (https://js.arcgis.com/3.16compact/init.js:192:253) at D._queryFeatureLayerSetup (https://js.arcgis.com/3.16compact/esri/dijit/FeatureTable.js:22:231) at https://js.arcgis.com/3.16compact/init.js:167:296 at c (https://js.arcgis.com/3.16compact/init.js:66:221) at d (https://js.arcgis.com/3.16compact/init.js:66:10) at resolve.callback (https://js.arcgis.com/3.16compact/init.js:67:350) at c (https://js.arcgis.com/3.16compact/init.js:66:436) at d (https://js.arcgis.com/3.16compact/init.js:66:10) at resolve.callback (https://js.arcgis.com/3.16compact/init.js:67:350) at Object.e._resDfd (https://js.arcgis.com/3.16compact/init.js:749:238)" I've tried with the outFields defined and with them commented out. There aren't any characters ] in my field names. The service is secure, but see my attachment for the field names for this layer. Hopefully someone spots something I've missed.
... View more
05-20-2016
01:21 PM
|
0
|
16
|
10564
|
|
POST
|
That would be a good suggestion for someone else, but I tried that a couple times before I posted.
... View more
04-06-2016
12:59 PM
|
0
|
1
|
1147
|
|
POST
|
I tried both and both are registered. I just noticed that Chrome was telling me it was attempting to load mixed content. I told it it was OK and now it's working. The symbol is such a light gray I didn't even notice it.
... View more
04-06-2016
12:13 PM
|
0
|
1
|
1147
|
|
POST
|
I downloaded WAB version 2.0, but I'm having problems getting it initialized. I thought maybe it didn't like the AppID I had created for WAB1.3, so I registered a new App. I installed 2.0 in a new directory and I'm not too concerned about keeping both versions up and running. I just want 2.0 to load. I got as far as the dialog that asked about my AGOL Url and my AppId. Once I click continue, I'm getting a mixed content kind of message init.js:1241 Mixed Content: The page at 'https://mymachineNameishere:3344/webappbuilder/?id=2' was loaded over HTTPS, but requested an insecure script 'http://mylocation.arcgis.com/sharing/rest/portals/self?f=json&token=MF3yCXU…W_ZZRpQjvSGeen&callback=dojo_request_script_callbacks.dojo_request_script0'. This request has been blocked; the content must be served over HTTPS. That's as far as I get. I don't remember having this problem starting up 1.3, but maybe I've just forgotten.
... View more
04-06-2016
12:03 PM
|
0
|
5
|
2625
|
|
POST
|
I've moved a few of my label points around and I think I got them all. Of course, once it gets placed on the web page and its smaller, they'll stop dropping off again. I see there's a parameter for sizeInfo. I suppose it's wishful thinking that I could tie that back to a font size somehow. I started out with a scale dependent renderer, which drew OK, but was below my shaded polygons, so it wasn't ideal. I changed the opacity, but you could tell the text was underneath.
... View more
04-05-2016
01:38 PM
|
0
|
0
|
2093
|
|
POST
|
Hurray for finding my dumb mistake. However, it doesn't solve my problem of missing county names, which I was hoping to resolve by using the 'recommended' method of labeling.
... View more
04-05-2016
01:24 PM
|
0
|
1
|
2093
|
|
POST
|
I've been using LabelLayer, but the documentation says I should be using LabelClass and setting the LabelingInfo on my FeatureLayer instead. This seems to be another robust objects that has almost no documentation, postings in the forum or examples to work from. Here's a link.Food Inspections in Missouri I got no takers on my previous posting about overlapping labels, so I'm hoping one of my other options will give me the results I'm looking for. I have a layer of labels in in ArcGISDynamicServiceLayer, but the hierarchy of featureLayer vs dynamicmeant my labels were under my shaded polygon. This shouldn't be so hard! I can just hear a web developer - "Why aren't you just using a Google map, it's so much easier? " Ugh. It works properly, it just needs county names. I'm not getting any errors, but this doesn't work: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=7,IE=9" />
<meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"/>
<title>Food Inspections in Missouri</title>
<link rel="stylesheet" href="https://community.esri.com//js.arcgis.com/3.16/dijit/themes/claro/claro.css"/>
<link rel="stylesheet" type="text/css" href="https://community.esri.com//js.arcgis.com/3.16/esri/css/esri.css">
<link rel="stylesheet" type="text/css" href="https://community.esri.com//esri.github.io/bootstrap-map-js/dist/css/bootstrapmap.min.css">
<style type="text/css">
html, body {
height: 100%;
width: 100%;
margin: 0;
padding: 0;
}
#mapDiv {
padding: 0;
height: 96%;
width: 100%;
min-height: 400px;
}
.esriPopup .titlePane, .esriPopup.dark .titlePane, .esriPopup.light .titlePane {
height: 20px;
background-color:#ffffff;
}
</style>
</head>
<body class="claro">
<script type="text/javascript">
var dojoConfig = {
parseOnLoad: false,
async: true,
packages: [{
name: 'js',
location: window.location.pathname.substring(0, window.location.pathname.lastIndexOf('/')) + "/js"
},{
name: 'bootstrap-map-js',
location: '//esri.github.io/bootstrap-map-js/src/'
}]
};
</script>
<script type="text/javascript" src="//js.arcgis.com/3.16compact/"></script>
<script type="text/javascript" >
require(["dojo/parser", "dojo/on", "dojo/dom","dojo/dom-construct", "esri/InfoTemplate",
"esri/dijit/Popup", "esri/SpatialReference", "esri/geometry/Extent","bootstrap-map-js/js/bootstrapmap",
"esri/layers/FeatureLayer", "esri/layers/ArcGISDynamicMapServiceLayer","esri/layers/LabelLayer",
"esri/layers/LabelClass",
"esri/renderers/SimpleRenderer","esri/renderers/ScaleDependentRenderer",
"esri/symbols/TextSymbol","esri/symbols/Font","esri/Color","esri/symbols/jsonUtils","js/mySymbol",
"dojo/domReady!"],
function(parser, on,dom, domConstruct, InfoTemplate,Popup,SpatialReference, Extent,
BootstrapMap,FeatureLayer,ArcGISDynamicMapServiceLayer,LabelClass, LabelLayer,SimpleRenderer,ScaleDependentRenderer,
TextSymbol,Font,Color,jsonUtils, mySymbol
){
window.app = {};
var pathName = "https://ogitest.oa.mo.gov";
var popup;
parser.parse();
app.spatialReference = new SpatialReference({ wkid: 102100 });
app.startExtent = new Extent(-10583000, 4287025, -9979000, 4980462, app.spatialReference);
popup = new Popup({
fillSymbol: mySymbol.highlightFillSymbol(),
markerSymbol: mySymbol.highlightMarkerSymbol()
}, domConstruct.create("div"));
app.map = BootstrapMap.create(dom.byId('mapDiv'), {
extent: app.startExtent,
slider:false,
autoResize:true,
scrollWheelZoom: false,
infoWindow: popup,
showLabels: true
});
app.map.on("load", function () {
app.map.disablePan();
app.map.disableMapNavigation();
});
on(app.map, "layers-add-result", function(e){
for (var i = 0; i < e.layers.length; i++) {
var result = (e.layers.error == undefined) ? "OK" : e.layers.error.message;
console.log(" - " + e.layers.layer.id + ": " + result);
}
});
var countyLayer = new FeatureLayer(pathName + "/arcgis/rest/services/BaseMap/county_simple/MapServer/0", {
id: "countyLayer",
mode: FeatureLayer.MODE_ONDEMAND,
outFields: ["*"]
});
var countyLabelPt = new FeatureLayer(pathName + "/arcgis/rest/services/DHSS/foodInspection_label/MapServer/0", {
id:'countyLabel',
mode: FeatureLayer.MODE_ONDEMAND,
outFields: ["*"]
})
var infoTemplate = new InfoTemplate(
"View Food Inspections",
"<a href= ${Web_Url} target=_blank ;'>${Agency_Name}</a>");
var inspectionCountyLayer = new FeatureLayer(pathName+"/arcgis/rest/services/DHSS/foodInspection/MapServer/1", {
mode: FeatureLayer.MODE_ONDEMAND,
outFields: ["*"],
infoTemplate: infoTemplate,
opacity:0.5
});
var inspectionCityLayer = new FeatureLayer(pathName+"/arcgis/rest/services/DHSS/foodInspection/MapServer/0", {
mode: FeatureLayer.MODE_ONDEMAND,
outFields: ["*"],
infoTemplate: infoTemplate
});
app.map.addLayers([countyLayer,inspectionCountyLayer,inspectionCityLayer]);
var labelClass = new LabelClass({
labelExpressionInfo: {
value: '{NAME}'
},
labelPlacement: 'center-center'
});
labelClass.symbol = jsonUtils.fromJson({
type: 'esriTS',
color: [0, 0, 255],
haloColor: [255, 255, 255],
haloSize: 1,
font: {
size: 8,
weight: 'bold',
family: 'sans-serif'
}
});
countyLabelPt.setLabelingInfo([ labelClass ]);
app.map.addLayer(countyLabelPt);
});
</script>
Click a shaded county to get information on food inspections.
<div id="mapDiv" ></div>
</body>
</html>
... View more
04-05-2016
01:06 PM
|
0
|
3
|
4350
|
|
POST
|
When you label using Desktop, you have all sorts of control about whether or not you want the labels to overlap, adding weights to features or other labels etc. Why is there not a little bit more control over the labeling on the client side? I have tried label layers and labelClass and defining scale dependent renderers of text symbols, but I'm never really satisfied. I feel like I need to take a step backwards and dig out some old code I saved from previous API versions, before so many samples got dropped off. I feel like most of the time there would be room for the text, but the labeling algorithm as determined there isn't enough room. I'm constantly ending up with just one or two counties that have no labels. And they aren't even the ones that I expect, they are counties with some size to them. I'm curious what preferred methods that people have for decent looking labels. Here's my example. We have a large number of counties for our size: 115. Food Inspections in Missouri
... View more
04-04-2016
02:50 PM
|
0
|
0
|
2898
|
|
POST
|
I would like to embed my WAB in a page, but also pass it an argument. How might I go about this? Dynamically create an iFrame? In my scenario, someone might want to do something on a web page first, maybe selecting something there from a list, and then pass it as a incoming URL parameter to the embedded map.
... View more
03-22-2016
12:27 PM
|
1
|
0
|
1656
|
|
POST
|
I've looked at the widget, but it's really way more complex than what I'm looking for. Thanks for the suggestion, though.
... View more
03-16-2016
09:56 AM
|
0
|
1
|
1125
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 06-02-2017 02:38 PM | |
| 2 | 03-18-2022 10:14 AM | |
| 2 | 02-18-2016 06:28 AM | |
| 1 | 03-18-2024 07:29 AM | |
| 4 | 08-02-2023 06:08 AM |
| Online Status |
Offline
|
| Date Last Visited |
02-25-2025
01:56 PM
|