New answers tagged

0

I confirm the above answer, I make my own version of it, it works. var all_layer_groups = map.getLayers(); var layer_group; for (i = 0, n = all_layer_groups.getLength() ; i < n; i++) { layer_group = all_layer_groups.item(i); if (layer_group.get('title') == 'your group name') { ...


1

In QGIS, you might install the QuickMapServices and QuickOSM plugin. From the first, you get an Openstreetmap background, and you can zoom to your area of interest. Then start the QuickOSM plugin, and enter highway for key and primary for value. Hit Run query, and you get only the primary roads, and some points on them (traffic lights etc). You might ...


0

you van also use the getState() function if (source instanceof ol.source.Vector) { source.on("change", function () { //console.log("Vector change, state: " + source.getState()); switch (source.getState()) { case "loading": $("#ajaxSpinnerImage").show(); break; ...


0

I just tried the example on a mobile browser (Android 4.4.4, firefox 46.0.1) and had the same problem. My guess is that it's a bug with mapbox.js and/or leaflet.


2

You can work with layer.bringToFront(), bringToBack() or setZIndex() to reorder your layers. If you want one layer to always be below all others you can listen for the layer's add event and then bring it to the back (and bring the other to the front the same way): var C300mVar1 = new L.geoJson(C300mVar1, { onEachFeature: function(feature, layer) { ...


0

I am not quite shure what the practical use of the Ctrl-drag feature is, but a way to distinguish duplicated from linked layers is the layer_id which is the same for linked layers and differs for duplicated layers (layer properties, see the variables-tab).


2

Your problem is that you add the layer within each step of the loop when you check if the lyer name exists. In fact you add road once for each layer that is not "road". Remove the loop and it should work. import arcpy,os,sys,fnmatch from arcpy import env env.workspace = r"G:\desktop\Project" insertLayer = ...


3

Rather than looping through the layers, you can use python's filter function to determine if the roads layer is present. So, replace for lyr in arcpy.mapping.ListLayers(mxd, "" ,df): if 'roads' not in lyr: arcpy.mapping.InsertLayer(df, refLayer, insertLayer, "BEFORE") # BEFORE\ AFTER with if not filter(lambda x: 'roads' in x.name, ...


4

Your variable lyr is a layer object and not a string or list of strings. Consequently, to avoid that error you need to replace: if 'roads' not in lyr: with if 'roads' not in lyr.name:


2

Under Processing toolbox (you need to have it switched to Advanced interface) you can find GRASS command v.out.dxf which with right click on it you can execute as batch process. After that you can select as many layers from open project as you like or browse into directory of your choice. For DXF vector output you only need to set first location and ...


3

Ok, this is not really an answer to the my question, but if you are interested in the biomass map I found a link from where you can download the actual data: http://whrc.org/publications-data/datasets/pantropical-national-level-carbon-stock/


2

I would recommend checking out rule based styling (e.g. here and here). Using rules you can setup various rule/expressions against the layer field(s) values to evaluate your various conditions. You may also stack rule symbols on-top of each other based on conditional priority using the Rendering order button. This may eliminate the step of having ...


1

I have modified a little bit the structure of your code in order to improve legibility and functionality. As mentioned at the begining of the html, I have used a block from a colleague that has all the elements (infowindows, tooltips, legend, fixed boxes...) added to a createLayer CartoDB.js map. Fist, have a look at the end of the block and observe how I ...


5

You simply have to save your style file(.qml/.sld). and everytime you import a new shape file, just load that style file.


2

You should save it as a template, so that each time you need it you can click project -> new from template. Just save your .qgs template file and copy it in the template directory (which can be found or specified in the General tab)



Top 50 recent answers are included