|
POST
|
I ended up changing the one really long field name from Regional_Supervisor to just Supervisor. That took care of the width without having to explicitly set a style for it. The height I still had to hard code before it looked right to me.
... View more
01-29-2016
02:13 PM
|
0
|
0
|
2867
|
|
POST
|
John, I suggest a separate function to define an array of visibleLayers and then use that array as the input to setVisibleLayers. What you have now makes no sense to me either. Also, It seems like you want to start out with visibility:false and then not turn it back to true until you have your visibleLayers defined.
... View more
01-29-2016
02:10 PM
|
0
|
0
|
2844
|
|
POST
|
Look at the line where you're specifying the update to the extent. You have a number that I'm sure must represent your spatialReference, but you can't just use the number. You need properly formed spatialReference, like: var sRef = new SpatialReference({wkid:2229}); Then you can use this variable in your extent: map.extent.update(EminX, EminY, EmaxX, EmaxY, sRef);
... View more
01-29-2016
01:58 PM
|
2
|
1
|
1249
|
|
POST
|
To elaborate on Robert's reply, make sure they are in the same order! This is a common mistake for new users. When I was first learning, I put each variable on their own line to check that I had every one matched up. It was easier for me to see where I'd missed one, or got it out of order. You can always edit it back to one long line later.
... View more
01-29-2016
01:16 PM
|
3
|
1
|
2118
|
|
POST
|
When I want to have a layer draw on top, I've used: var numLayers = map.layerIds.length -1 map.reorderLayer(myLayer, numLayers); It seems like you ought to be able to find the number of graphicsLayers, adding it numLayers to make a sum total, then reorder the layer to be at the very top. I haven't tested this, though.
... View more
01-29-2016
12:24 PM
|
1
|
3
|
1550
|
|
POST
|
You need to use a function for setting the content of your infoTemplate. If you search the forum for infotemplate.setcontent, I'm sure you'll find several examples. I end up using a function over half the time. Instead of using ${fieldName}, you'll use graphic.attributes.fieldName. The function can get quite long, depending on the number of attributes and how many you're checking for empty values. var myInfoTemplate = new InfoTemplate("your Title"); myInfoTemplate.setContent(generateInfoContent); function generateInfoContent(graphic) { var formatString = "myFieldName:" + graphic.attributes.X; var checkY = graphic.attributes.Y; //only appends if there is a value for attribute 'Y' if (checkY} { formatString += checkY; } formatString += graphic.attributes.Z; return formatString; }
... View more
01-29-2016
12:10 PM
|
1
|
2
|
1838
|
|
POST
|
I am setting up an editor widget and I have included the delete button in the attributeinspector. Rather than just deleting the record, I'd like to insert a dialog, that has a prompt like "Are you sure you want to delete?" I assume I can use the result of the user's choice to determine whether or not to actually apply the edit. I think I can use 'before-apply-edits' for this, but I can't wrap my head around how it all fits together. Does anyone has an example to share?
... View more
01-29-2016
06:55 AM
|
0
|
1
|
3344
|
|
POST
|
This is the World geocoder. You'll see this in the ESRI sample: http://developers.arcgis.com/javascript/sandbox/sandbox.html?sample=search_basic The address is 102 Westwood Blvd, Fulton, MO If you enter this into the Search, the address comes up as a suggestion , so you get the idea that its found an exact match. But the result is only to the street Westwood Blvd, not to 102 Westwood Blvd. I was surprised to see a different search result. I would have expected that if it couldn't find 102 Westwood, it would only suggest Westwood Blvd at the street level in the first place.
... View more
01-28-2016
01:50 PM
|
1
|
2
|
2461
|
|
POST
|
What is the difference in the source for the Search widget suggestion (the ones in the dropdown) as opposed to what gets returned from a geocode? Usually an address that appears in the list of suggested addresses is what you get when you geocode. We have an instance where the address appears there, but when geocoded only returns a streetName level match.
... View more
01-28-2016
12:26 PM
|
0
|
4
|
4543
|
|
POST
|
Yes, it does. I just now realized something. As long as the feature is still selected, it has the original attributes. But if I click away from it, so it's un-selected, and then select it again, I see that it has the updated coordinates. It was working, but it didn't look like it was .... Have you ever used graphic.attr(name, value)? Reading the documentation, it sure sounded like it was what I needed, as opposed to going through the applyEdits process.
... View more
01-27-2016
11:13 AM
|
0
|
1
|
2051
|
|
POST
|
I modified the latitude/longitude to numbers. That didn't fix anything. I also didn't have the graphic constructor correct. It should have been curentGraphic.geometry. var updateGraphic = new Graphic(currentGraphic.geometry, mySymbols.redPinSymbol_edit() ,att); Still isn't updating the attributes.
... View more
01-27-2016
10:09 AM
|
0
|
1
|
2051
|
|
POST
|
I've been looking at attr(name,value), which is something in the FeatureLayer documentation. That seems more straight forward, since I'm just trying to modify a couple of attributes. That doesn't work either, or I don't have the syntax right. I think maybe my lat and long coordinates are coming through typed as string. I'm going to get them changed to a number and see if that's the problem.
... View more
01-27-2016
09:48 AM
|
0
|
0
|
2051
|
|
POST
|
An error like that isn't the right syntax .... Uncaught TypeError: Cannot read property '_getInfo' of undefined.
... View more
01-27-2016
09:46 AM
|
0
|
0
|
2051
|
|
POST
|
I'm confused about how to use applyEdits to update my latitude and longitude columns once my graphic has been moved. It seems like I need to have a complete Graphic element created to use as input for applyEdits. This isn't giving my any errors, but when I tried this, it doesn't change my attributes. app.myEditor.editToolbar.on('graphic-move-stop', function(evt){
var currentGraphic = evt.graphic;
var latLongCoord = webMercatorUtils.xyToLngLat(evt.graphic.geometry.x, evt.graphic.geometry.y);
// console.log("Latitude: " + latLongCoord[1] + ", Longitude: " + latLongCoord[0]);
var latCoor = latLongCoord[1].toFixed(6);
var longCoor = latLongCoord[0].toFixed(6);
var att = {
"OBJECTID":currentGraphic.attributes.OBJECTID,
"Name": currentGraphic.attributes.Name,
"Address": currentGraphic.attributes.Address,
"City": currentGraphic.attributes.City,
"State": currentGraphic.attributes.State,
"ZIP": currentGraphic.attributes.ZIP,
"Phone": currentGraphic.attributes.Phone,
"Cell": currentGraphic.attributes.Cell,
"Latitude": latCoor,
"Longitude":longCoor
}
var updateGraphic = new Graphic(currentGraphic,mySymbols.redPinSymbol_edit(),att);
app.eusLayer.applyEdits(null,[updateGraphic], null );
});
... View more
01-27-2016
09:18 AM
|
0
|
7
|
4011
|
|
POST
|
I would like to have a ZoomTo button in my AttributeInspector dialog. I see it in the actionPane, but hidden, I assume because the tool wouldn't actually work if I displayed that pane. I'm working at a state-wide perspective and my users are used to being able to zoom in closer to a location from an information tag. The attributeInspector is part of my Editor constructor, and not something I've defined by itself. initEditor: function (evt, geometryService, map) {
var layers = [];
var templatePicker = new TemplatePicker({
featureLayers: [app.eusLayer],
columns: 1,
style: "height: 100%; width: 150px; border: 2px",
showTooltip: true
}, "templateDiv");
templatePicker.startup();
layers.push({featureLayer: app.eusLayer });
var settings = {
map: map,
templatePicker: templatePicker,
geometryService: geometryService,
layerInfos: layers,
toolbarVisible: false
};
var params = { settings: settings };
app.myEditor = new Editor(params, 'editorDiv');
app.myEditor.startup();
var itmLbl = query('.itemLabel');
itmLbl[0].innerHTML = 'Click to Add New Staff';
esriBundle.widgets.attributeInspector.NLS_deleteFeature = "Delete Staff Location";
on(templatePicker, 'selection-change', function (evt) {
app.editEnabled = true;
});
var attInspector = app.myEditor.attributeInspector;
on (attInspector, 'attribute-change', function (evt) {
app.editEnabled = false;
});
} I have a chunk of code I've used in the past to add a ZoomTo button to an infoTemplate, because when using bootstrap style, it doesn't include one for some reason. This likely needs to be modified for this purpose. I'm also not sure where this goes. var link = dom.byId('zoomLink');
if (!link ) {
link = domConstruct.create("a", {
"class": "action zoomTo myZoom",
"id": "zoomLink",
"title": "Zoom in",
"innerHTML": "Zoom To", //text that appears in the popup for the link
"href": "javascript: void(0);"
}, query(".sizer", app.map.infoWindow.domNode)[1]);
}
on(link, "click", zoomTo);
function zoomTo(){
var geom = currentGraphic.geometry;
var lod = app.map.getLevel();
app.map.centerAndZoom(geom, lod + 4);
app.map.infoWindow.setFeatures(currentGraphic);
app.map.infoWindow.show(geom);
}
... View more
01-27-2016
08:08 AM
|
0
|
3
|
3607
|
| 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
|