Tag Info

New answers tagged

0

Sorry for taking so long to respond to this - I forgot all about it! In the end I discovered too many other limitations with the Dijit Legend widget, so ultimately I created my own, using an ajax call to the legend on the REST endpoint (.../MapServer/legend?f=pjson) to obtain the necessary info, including the symbol, which I was then able to style however I ...


2

The legend is a summary of the raster values. Therefore, you will need to extract the pertinent raster values. This should do it: library(raster) data(volcano) r = raster(volcano) min = minValue(r) max = maxValue(r) l = c(min:max) result = l[l %% 20 == 0] > result [1] 100 120 140 160 180


1

To do this I think you would need to look into using ArcPy to clone text and graphic elements. The code is far from trivial but would have much in common with the GraphicElement example 2 which is provided to "construct a graphic table based on data values from a table in the map document". However, I suspect that you will find it much easier to write a ...


1

It looks like you have not declared legendLayers as an array (var legendLayers = [];) before using it. If that doesn't solve your problem, could you paste the error that you get when you run this code in the browser?


0

You have not included the version of ArcGIS for Desktop that you are using but the error message you are seeing is consistent with it being ArcGIS Desktop 10.0 because the listLegendItemLayers method was only added to the LegendElement Class at ArcGIS 10.1 for Desktop. I am not aware of any workaround to doing this at 10.0 so I recommend upgrading to 10.1 ...


0

Maybe replace : legend = arcpy.mapping.ListLayoutElements(mxd,"LEGEND_ELEMENT")[0] for lyr in legend.listLegendItemLayers(): With the following: legend = arcpy.mapping.ListLayoutElements(mxd,"LEGEND_ELEMENT")[0] legendObject = legend[0] for lyr in legendObject.listLegendItemLayers(): I believe, possibly, that the legend object you've created by ...


0

Perhaps use DOM methods to replace the contents of the div. http://leafletjs.com/examples/choropleth.html look at the info.update function which sets the innerHTML.


1

I generally agree with both of the other answers but just wanted to add this answer to discuss what things you can edit with the legend as a graphic. First off to edit individual items like change one of the field titles or delete an element right click the legend you converted to graphic and select "Ungroup": You can ungroup elements further by selecting ...


1

Best practice is to get your legend as close to what you want as possible before converting. Start off by giving the layers more readable names -- for example, change the layer name from "InterwarProstitues$Events" to "Prostitutes". Set the symbology how you want it. (This should definitely be done in the layers rather than in the legend, to ensure your ...


5

I don't know what you've read, but if you convert your legend to a graphic you can only edit graphic properties. It's no longer a legend object. ESRI help on converting map elements to graphics (bottom of page). Edit: First, you have to do this in a new legend. You can't edit a graphic in the way you're thinking. Anyway, there are two methods. One, in the ...


0

I resolve it! The problem was that there was a Chile's Layer that it was taking too much time to load (47 sec) and then the legend also was trying to load. The solution was to load the legend after the webpage it was loade with this code: document.onreadystatechange = function() { if (document.readyState === 'complete') { loadLegendLayers(); } ...



Top 50 recent answers are included