How to add layers with different zoom levels to the layer group in geoserver? - gis

How to add layers with different zoom levels to the layer group in geoserver?
For example,
layer1 - zoom level 5-8,
layer2 - zoom level 9-12
How to set the layers different zoom levels in geoserver?
Can you help me this issue? Thanks.

Layer Groups don't care about your visibility settings so you can add all of them together.
If what you are actually asking is how to make a layer only visible at some zoom levels? then you need to add <MinScaleDenominator> and <MaxScaleDenominator> to your SLD (or other styling method) - see the sld cookbook for an example.

Related

Get elements inside applied cutplanes autodesk forge

I am using Forge's viewer.setCutPlanes() function to set the cutplanes along with levels, so it will apply the cutplanes horizontally to cut the model level wise. I have two Vector4, as planes, I pass these two planes to the setCutPlanes() function. Now I want to get all elements those are inside the cutplanes, which means, only those elements which are visible in viewer after applying the cutplanes. How can I achieve that?
You could use the Viewer APIs to iterate through the geometry fragments of all objects in your design, get their bounding boxes, and check whether they're between your clipping planes. The process of obtaining the geometry bounds is explained in this blog post: https://forge.autodesk.com/blog/working-2d-and-3d-scenes-and-geometry-forge-viewer.
You can also re-use the 'window selection' example (https://forge.autodesk.com/blog/custom-window-selection-forge-viewer-part-iii) and switch the 8 frustum points to the section plane points.

Geoserver Multiple ImageMosaic Rasters Issue

I am attempting to develop a stack of OS Raster basemaps to be served by Geoserver as WMS.
I have set up separate image mosaic layers for the different map styles, and set appropriate Zoom Layering levels as styles for the layers. Each individual layer displays as required both in OL preview and within GIS applications.
If I combine these layers in a Layer Group however, the preview displays a blank image, although the Palette_Index values are displayed for both layers underneath the preview image.
Is it possible to accomplish what I am attempting to do in Geoserver, and serve the multiple raster layers as a single WMS?
Any assistance would be greatly appreciated.
ADD:
Geoserver version is 2.8.0
Layer Group is simply compiled of the two imagemosaic Layers. The only change I have made from the default selections is to compute the bounds and apply an SLD style to each layer with a simple MaxScaleDenominator added which works for the layers when viewed individually.
Also tried with the standard raster sld with no editing, and the issue persists

Showing sets of markers on different layers of Google map

I need to show a set of markers on a Google map.
I know markers can be added directly on a Google map but given that I have 3 sets of markers, one for shops, one for parks and another one for hotels, how can I show them on 3 different layers and so that later on using javascript, I be able to hide one set of markers by doing sort of:
myLayer2.setMap(null);
I have checked Panoramio layer but it needs the images first to be uploaded to panoramio, but in my case for some particular security reason I cannot upload them to panoramio. I will have images locally and set those at runtime based upon some criteria.
Is there some way to do layer based work without using panoramio approach?
The Maps-API doesn't support this kind of custom layers(as you maybe know them from other map-API's like e.g. leaflet).
But it's not hard to achieve a similar feature.
You may use a google.maps.MVCObject. for every "layer" create a property for this MVCObject and set the value of this property to null or the google.maps.Map-instance(
depending on the desired initial state of the "layer")
var myLayers=new google.maps.MVCObject();
myLayers.setValues({parks:null,shops:null,hotels:map});
//hotels initially are visible
When you want to add a Overlay...e.g. a Marker, to a "layer", bind the map-property of that Overlay to the related property of the MVCObject:
parkMarker=new google.maps.Marker({/*options*/});
parkMarker.bindTo('map',myLayers,'parks');
To toggle the display of all features within that "layer" you only need to set the property of the MVCObject:
//show the parks
myLayers.set('parks',map);
//hide the hotels
myLayers.set('hotels',null);
Demo: http://jsfiddle.net/doktormolle/UA85N/

Google Maps Number of KML layers limit

We used to be able to display 7 KML layers on google map. But now it's only possible to show 5 layers. It's documented:
You can use the Maps API to add up to five Fusion Tables layers to a map, one of which can be >styled with up to five styling rules.
But I didn't see similar limit for KML layers. Is this a undocumented new change?
More detail:
The layers are toggled with checkboxes, when all 7 checkboxes are checked, only the first 5 layers are shown. If I hide the first layer, the sixth layer will immediately show.
I think the bug may still be there or maybe back in a different form. I am trying to load 27 kml files (total size 77.6 kb - well under the limit) and it seems to only be able to load 25 - if I turn off two layers using the dropdown the map loads fine. See http://www.trammaps.com/Map.html,
Regards,
Lea.

Atlas style map index for static google map

I'm using a static google map, but really this problem could apply to any maps project. I want to divide a map into multiple quadrants (of say 50x50 pixels) and label the columns as A, B, C.... and the rows as 1, 2, 3...
Next I plan to do something like,
1) Find the markers which are the farthest north, east, south, and west
2) Use that info to to define the bounding boxes of each row and column box
3) Classify each marker by its row and column (Example Marker 1 = [A,2])
A few requirements,
I don't know the zoom level because I let Google set the zoom level appropriately for me and I would rather not use an algorithm that is dependent on a zoom level. I do however know the locations of all of the markers that are shown on the map.
Here is an example of a map that I would like to classify the markers for,
static map example link.
I found these which look like a good start,
Resource 1, Resource 2
But I think I'm still in need of some help getting started. Can anyone help write out some pseudo code or post a few more resources? I'm kind of in a rut at the moment.
Thanks! Much appreciated of any help!
Ok two days into this I finally got it. Thought I would share my thoughts with people who stumble upon this later.
Following the PHP code on this site and for translating lat,lng pairs to pixel coordinates, I was able to classify the individual pixel row by the x value and the column by the pixels y value.
To calculate the zoom level, I determine the maxLat, maxLng, minLat, and minLng values defined by the collection of markers. Then I calculated the bounds of the map at a given zoom level. Finally I used a brute force method of checking if the new bounds of the map determined by the zoom level would include the bounds defined by the max,min lat,lng values of the collection of markers. Starting at zoom level 21 (max zoom on google maps) I decrement the zoom level until I find a zoom level that includes all the markers.
It seems, that the zoom level that is calculated in this method matches Google's preset zoom level selected automatically if you do not provide a zoom level for a static map.
In PHP there is a nice library to do all of this here.