Tag Info

Hot answers tagged

7

Have you seen this issue created one the LeafLet github repo: https://github.com/Leaflet/Leaflet/issues/167 try to use addLayer(layer,true); to add a tile layer to the bottom. I'm afraid that's all there is and this second optional argument is not even documented. Update Sept 2014 Leaflet now supports setting the zIndex. Thanks to @knutole in the ...


3

AFAIK the label of a feature has by default the same z-index than the marker and the "correct" way to change the z-index of a marker is with the constructor option zIndexOffset or the method setZIndexOffset.


2

You would first need to tweak the SpatiaLite provider by either add a OrderBy property and apply that to the relevant queries (GetGeometriesInView, ...), or update the provider to handle spatial views correctly. Then you need to apply a custom theme setting assigning the appropriate color in respect to ZOrder. Why don't you want several layers? Hth ...


2

The best way to achieve this would be to register an event handler for the map's changelayer event. Within this event handler you can identify the layer whose visibility has changed and its current z-index, which you can then use to calculate a delta that can be used with the map's raiseLayer function - or you could just use setLayerIndex and specify n + 1 ...


2

It is not as easy as it used to be, but there are some helper methods for the collection. That should allow you to do similar things as ThomasG77 described above. Assuming you have a map named map, with 4 layers i.e. [base_layer, coastlines, heatmap, markers] Then you can get the collection via map.getLayers(), and the array of layers via ...


1

Try something like: map.getLayers().setAt(99, markers) The list of layers is in an object inheriting from an ol.Collection. See the API doc for it. Be careful, I'm pretty sure, you can't use arbitrary number like 99 in setAt: first arg is for the position in the array of layers and the second arg is for the layer element reference you want to move. To ...


1

neither createLayer or createVis return a leaflet layer, the right way would be var map = new L.map('map', { center : [42.339926, -83.04137], zoom : 13 }); // add here your mapbox layer createLayer(map,vizjson_url).addTo(map).done(function(layer) { layer.setZIndex(1); }) createLayer(map,vizjson_url2).addTo(map).done(function(layer) { ...


1

I understood the problem wrong, tried to jsfiddle this for a change. I assume you need a workaround, hence I'm going this road. Getting this to work on jsfiddle but had to do some things differently to make it work but I see your issue now. bugreport you opened has got it right, best solution is: beforefeaturehighlighted: function(e) { if ...


1

You can trigger the render intents (select, hover, default) in the stylemap with the SelectFeature control. Here is a DEMO var hoverControl = new OpenLayers.Control.SelectFeature(     [layer],     {         hover: true,         highlightOnly: true     } ); map.addControl(hoverControl); hoverControl.activate(); UPDATE: As you can see from this question ...



Only top voted, non community-wiki answers of a minimum length are eligible