POST
|
I was playing around with this more and found the answer, and it's really, really silly. When you create your grid, one of the column IDs must be "id", just like in the sample. As soon as I made that change, the problem disappeared. The column label can still be whatever you want.
... View more
11-15-2013
05:05 AM
|
1
|
1
|
1303
|
POST
|
In my case, selectionMode: "single" doesn't have any effect at all. I also just now noticed that by including that grid.selectionClear(); line in my function, the first row of the grid will never highlight, so it seems like every time that function fires it's not clearing my selection, it's just clearing the first row.
... View more
11-14-2013
04:31 AM
|
0
|
0
|
1303
|
POST
|
I'm working with the dgrid sample for my own map. I've got most everything set up and functioning the way I want, but if I've clicked on a row in the grid, and then click on another row, both rows are highlighted. If I click another row, all three are highlighted, and so forth. I tried adding the grid.selectionClear(); line to the function but it doesn't seem to do anything. I also don't see anything in the sample code that instructs the grid to clear its current selection when a new row is clicked. Any ideas? Code: <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"> <title>Charter Guide Map</title> <link rel="stylesheet" href="http://js.arcgis.com/3.7/js/dojo/dojo/resources/dojo.css"> <link rel="stylesheet" href="http://js.arcgis.com/3.7/js/dgrid/css/dgrid.css"> <link rel="stylesheet" href="http://js.arcgis.com/3.7/js/dgrid/css/skins/tundra.css"> <link rel="stylesheet" href="http://js.arcgis.com/3.7/js/dojo/dijit/themes/tundra/tundra.css"> <link rel="stylesheet" href="http://js.arcgis.com/3.7/js/esri/css/esri.css"> <style> html, body { height: 100%; width: 100%; margin: 0; padding: 0; overflow: hidden; } td { padding:3px; } #container { height: 100%; visibility: hidden; } #bottomPane { height: 200px; } #grid { height: 100%; } .dgrid { border: none; } .field-Business_C { cursor: pointer; } </style> <script src="http://js.arcgis.com/3.7/"></script> <script> // load dgrid, esri and dojo modules // create the grid and the map // then parse the dijit layout dijits require([ "dojo/ready", "dgrid/OnDemandGrid", "dgrid/Selection", "dojo/store/Memory", "dojo/_base/array", "dojo/dom-style", "dijit/registry", "esri/map", "esri/layers/FeatureLayer", "esri/symbols/SimpleFillSymbol", "esri/tasks/QueryTask", "esri/tasks/query", "dojo/_base/declare", "dojo/number", "dojo/on", "dojo/parser", "dijit/layout/BorderContainer", "dijit/layout/ContentPane" ], function( ready, Grid, Selection, Memory, array, domStyle, registry, Map, FeatureLayer, SimpleFillSymbol, QueryTask, Query, declare, dojoNum, on, parser ) { ready(function() { parser.parse(); // create the dgrid grid = new (declare([Grid, Selection]))({ // use Infinity so that all data is available in the grid bufferRows: Infinity, columns: { "Business_C": "Business/Captain Name", "Address": "Address", "Phone_1": "Phone Number", "Email_Addr": "Email Address", "Maximum_Si": "Max Size of Charter", "Web_Addres": "Website", "Region_s_" : "Regions" } }, "grid"); // add a click listener on the ID column grid.on(".field-Business_C:click", selectCaptain); map = new Map("map", { basemap: "satellite", center: [-76.5, 38.9], zoom: 9 }); chartersUrl = "http://services.arcgis.com/njFNhDsUCentVYJW/arcgis/rest/services/CharterGuide/FeatureServer/0"; outFields = ["Business_C", "Address", "Phone_1", "Email_Addr", "Maximum_Si", "Web_Addres", "Region_s_", "Chesapeake", "Vessel_Nam", "Phone_2", "Fishing_Me", "Other_Regi", "Targeted_S"]; var infoTemplate = new esri.InfoTemplate(); infoTemplate.setTitle("${Business_C}"); infoTemplate.setContent( "<table border='0', width='100%'>" + "<tr><td width='50%' width='100%' valign='top'>Vessel Name:</td><td width='50%' valign='bottom'> ${Vessel_Nam}</td></tr>" + "<tr><td width='50%' width='100%' valign='top'>Business/Captain Name:</td><td width='50%' valign='bottom'> ${Business_C}</td></tr>" + "<tr><td width='50%' width='100%' valign='top'>Marina Address:</td><td width='50%' valign='bottom'> ${Address}</td></tr>" + "<tr><td width='50%' width='100%' valign='top'>Phone 1:</td><td width='50%' valign='bottom'> ${Phone_1}</td></tr>" + "<tr><td width='50%' width='100%' valign='top'>Phone 2:</td><td width='50%' valign='bottom'> ${Phone_2}</td></tr>" + "<tr><td width='50%' width='100%' valign='top'>Email:</td><td width='50%' valign='bottom'> ${Email_Addr}</td></tr>" + "<tr><td width='50%' width='100%' valign='top'>Maximum Size of Charter:</td><td width='50%' valign='bottom'> ${Maximum_Si}</td></tr>" + "<tr><td width='50%' width='100%' valign='top'>Web Address:</td><td width='50%' valign='bottom'> ${Web_Addres}</td></tr>" + "<tr><td width='50%' width='100%' valign='top'>Fishing Method:</td><td width='50%' valign='bottom'> ${Fishing_Me}</td></tr>" + "<tr><td width='50%' width='100%' valign='top'>Regions Covered:</td><td width='50%' valign='bottom'> ${Region_s_}</td></tr>" + "<tr><td width='50%' width='100%' valign='top'>Chesapeake Bay:</td><td width='50%' valign='bottom'> ${Chesapeake}</td></tr>" + "<tr><td width='50%' width='100%' valign='top'>Other Regions Covered:</td><td width='50%' valign='bottom'> ${Other_Regi}</td></tr>" + "<tr><td width='50%' width='100%' valign='top'>Targeted Species:</td><td width='50%' valign='bottom'> ${Targeted_S}</td></tr>" + "</table>" ); map.infoWindow.resize(400,300) var highlight = new esri.symbol.SimpleMarkerSymbol(esri.symbol.SimpleMarkerSymbol.STYLE_SQUARE, 16, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([0,255,255]), 3), new dojo.Color([0,255,255,0])); var fl = new FeatureLayer(chartersUrl, { id: "charters", mode: 1, outFields: outFields, infoTemplate: infoTemplate }); fl.on("click", function() { map.graphics.clear(); }); // change cursor to indicate features are click-able fl.on("mouse-over", function() { map.setMapCursor("pointer"); }); fl.on("mouse-out", function() { map.setMapCursor("default"); }); map.addLayer(fl); map.on("load", function( evt ){ // show the border container now that the dijits // are rendered and the map has loaded domStyle.set(registry.byId("container").domNode, "visibility", "visible"); populateGrid(Memory); // pass a reference to the MemoryStore constructor }); function populateGrid(Memory) { var qt = new QueryTask(chartersUrl); var query = new Query(); query.where = "1=1"; query.returnGeometry = false; query.outFields = outFields; qt.execute(query, function(results) { var data = array.map(results.features, function(feature) { return { // property names used here match those used when creating the dgrid "Business_C": feature.attributes[outFields[0]], "Address": feature.attributes[outFields[1]], "Phone_1": feature.attributes[outFields[2]], "Email_Addr": feature.attributes[outFields[3]], "Maximum_Si": feature.attributes[outFields[4]], "Web_Addres": feature.attributes[outFields[5]], "Region_s_": feature.attributes[outFields[6]] } }); var memStore = new Memory({ data: data }); grid.set("store", memStore); }); } // fires when a row in the dgrid is clicked function selectCaptain(e) { grid.clearSelection(); map.infoWindow.hide(); map.graphics.clear(); var fl = map.getLayer("charters"); var query = new Query(); captainName = (e.target.innerHTML); query.where = "Business_C = '" + captainName + "'"; fl.selectFeatures(query, FeatureLayer.SELECTION_NEW, function(result) { map.centerAt(result[0].geometry); map.graphics.add(new esri.Graphic(result[0].geometry, highlight)); }); } } ); }); </script> </head> <body class="tundra"> <div id="container" data-dojo-type="dijit/layout/BorderContainer" data-dojo-props="design: 'headline', gutters: false"> <div id="map" data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region: 'center'"></div> <div id="bottomPane" data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region: 'bottom'"> <div id="grid"></div> </div> </div> </body> </html>
... View more
11-13-2013
09:28 AM
|
0
|
10
|
6855
|
POST
|
I'm using the following sample: https://developers.arcgis.com/en/javascript/jssamples/fl_dgrid.html One of my fields is a date field, and I'm having trouble getting it to show up properly (they're showing up as a string of numbers). I've been going through the documentation but haven't had much luck figuring out how to tell dojo to read it as a date and not a string.
... View more
11-07-2013
10:39 AM
|
0
|
1
|
700
|
POST
|
Is there a way to change the size of the popups within web maps in AGOL? I know I can download the code and adjust it programatically, but that seems like some unnecessary steps to something that seems like it should be doable within an AGOL web map.
... View more
11-05-2013
08:29 AM
|
0
|
1
|
465
|
POST
|
Sorry, yeah, the points are centroids of the polygons. They were only created to make the features more noticeable when zoomed out. While I agree your first option would be easiest, since I have to go through another person to update our services (and I've already bugged her enough about this particular project!) I was hoping I could do through the JS. It sounds like your second option would work for that...I think I have an idea of how it might work.
... View more
07-24-2013
07:31 AM
|
0
|
0
|
595
|
POST
|
I'm working on a simple map with two layers representing the same features. One is a point layer that only displays when the user is zoomed out beyond a certain scale, and the other is a polygon layer that only displays when zoomed in far enough. The polygon layer has all the attributes that I'd like to display in the info window, but I'd like users to be able to see this information when clicking on the point layer, and I'm not sure how to accomplish this. I tried removing the min/max scale from the polygon layer, and that does work, but since some of the polygons are rather small (especially when zoomed out), it's difficult to move the mouse cursor directly over them when zoomed out. Is there another way I can accomplish this?
... View more
07-24-2013
06:59 AM
|
0
|
7
|
1047
|
POST
|
Thanks for the response. Here's a link to a map having this issue: http://maryland.maps.arcgis.com/home/item.html?id=748787ded9864b3fba6d32843a1ebb72. The map is zoomed to the state of Maryland, which is in the scale range of the layer, and it was added directly to the map. The only common theme I can see throughout these maps is the file size of the layers in them - they're all pretty darn big. However, other maps with large, complex datasets seem to be fine, so I'm not sure that has any relevance.
... View more
05-15-2013
05:18 AM
|
0
|
0
|
516
|
POST
|
I have a number of maps created and saved on my ArcGIS Online account. When I save the map - in most cases - the thumbnail is automatically generated based on the extent of the features; it shows the basemap and the layers added to the map. For some of my maps, though, there is no thumbnail at all. I also tried changing the basemap on one service, but I didn't see the change reflected in the thumbnail. The only idea I've come up with so far is that all of the offending maps are using large layers (>2mb in size); but, not all of the maps with large layers are experiencing this problem, so I'm not sure if that's related. I know I can add a thumbnail image myself, but taking a screen grab of the map and shrinking it to fit the thumbnail requirements is a cumbersome process that I'd like to avoid if possible.
... View more
05-14-2013
12:32 PM
|
0
|
3
|
3992
|
POST
|
I'm trying to incorporate a map service with point data into my web map, but the points are ridiculously huge. Unfortunately, my organization doesn't host the service so I can't change it; I'm guessing the only way to do this is to create custom symbology. The data is currently set up to be symbolized by unique values - which I want - but I don't want to have to create five custom symbols for each of the different unique values as that seems like a lot of excess, messy code. Is there a simple way to override only the size of the points while leaving the rest of the symbology to the default of the map service?
... View more
05-14-2013
05:48 AM
|
0
|
0
|
616
|
POST
|
Can you share a URL to your map so we can take a look? Layer ordering is a bit tricky in web maps. Some layers can't be drawn on top of others. For example, any map notes, CSVs, shapefiles added to the map can't be moved under a layer from a map service. So maybe the software is making you think that it can, which would be a bug, but then when you open the map again, the layers are drawn as the system can support. Thanks, Mike I'm getting this bug too. In the map it lets me reorder layers added to the map above feature services, and save that way, but when viewing the map again the order isn't actually saved. It's pretty frustrating.
... View more
05-03-2013
05:48 AM
|
0
|
0
|
380
|
POST
|
I'm guessing the idea is to click a button and the polyline will be entered with the last vertex created as the final vertex. Can you use the finishDrawing() method? Create a button and have clicking it call a function that executes drawToolbar.finishDrawing();
... View more
04-03-2013
11:08 AM
|
0
|
0
|
301
|
POST
|
Working fine for me using the same version of Chrome. I just tried testing the directions widget under latest samples.
... View more
03-26-2013
06:42 AM
|
0
|
0
|
1193
|
POST
|
Could you post the code you've tried to implement? It's going to be difficult to help without seeing what you've got so far.
... View more
03-26-2013
05:38 AM
|
0
|
0
|
325
|
Title | Kudos | Posted |
---|---|---|
1 | 03-02-2015 06:48 AM | |
1 | 07-01-2015 07:35 AM | |
1 | 07-01-2015 11:16 AM | |
1 | 01-21-2020 07:34 AM | |
1 | 03-08-2016 11:30 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|