Provide working minimalistic openlayers WMS example
If you want to use SEDAC WMS with openlayers.js, it would be nice to provide a (link to a ) working sample code like http://jsfiddle.net/F9pUs/ (which actually does not show the SEDAC layer)
-
Farhan Ali commented
SEDAC UserVoice is an impressive platform for gathering and responding to user feedback. It’s great to see services that prioritize user engagement and foster improvement through community insights. If you're interested in user-driven platforms, check out https://nulls-brawls.com.tr/ .it’s a fantastic community-driven site offering unique insights and resources!
-
Riny commented
To conclude: the minimal example at http://jsfiddle.net/dNz9W/4/ is working right.
There is one strange behavour in this setup that does not work well though:
When the SEDAC WMS layer is set to act as a transparent overlay by setting "isBaseLayer: false" there is only one tile showing up.You can see this behaviour at : http://jsfiddle.net/yhEBN/1/embedded/result/
Is this sedac or openlayers related?
Thank you
------------
var map = new OpenLayers.Map("map");
var osm = new OpenLayers.Layer.OSM("OpenStreetMap");
var sedac = new OpenLayers.Layer.WMS("Population Density", "http://sedac.ciesin.columbia.edu/geoserver/ows", {
layers: 'gpw-v3:gpw-v3-population-density_2000',
transparency : true
},{
opacity: 0.5,
isBaseLayer: false,
});map.addLayer(osm);
map.addLayer(sedac);
map.addControl(new OpenLayers.Control.LayerSwitcher());
map.setCenter(new OpenLayers.LonLat(0, 0), 2);
-
Riny commented
Thank you, that is a very nice and clean way of legend inclusion.
-
AdminWebmaster (Webmaster, SEDAC) commented
this is not supported by the openlayers layer switcher as far as i know. support for legends in our client is custom built functionality.
you just need to perform a getlegend request to the map server:
(hit that url in your browser and you'll get a legend)
note the value of 'layer' is the same value used to request the tiles from the server. the 'style' param is also accepted.
-
Anonymous commented
please include a mnimal example of legenda like you use in the left sidebar of your map client http://sedac.ciesin.columbia.edu/maps/client.
-
Riny commented
Webmaster, thank you, I added the suggestions in a more or less working example: http://jsfiddle.net/EQk97/
-
AdminWebmaster (Webmaster, SEDAC) commented
As previously mentioned, we're looking to provide more details & documentation. We're preparing for a new major release, and will be included in this new release.
One thing to note is that our cached layers only work with the following resolutions:
[
2.00167551711953,
1.0008377585597652,
0.5004188792798824,
0.33361258618658834,
0.16680629309329414,
0.08340314654664707,
0.03336125861865884,
0.016680629309329415,
0.008340314654664708
]our non-cached service url is:
http://sedac.ciesin.columbia.edu/geoserver/ows.use that instead of:
http://sedac.ciesin.columbia.edu/geoserver/gwc/service/wmsnote -- this means it will be slower to render, since its not cached. if you want to use our cached service, be sure to set the resolutions above within your map properties:
new OpenLayers.Map("id", {
resolutions: [array-displayed-above!]
});hopefully that should do it.
-
AdminWebmaster (Webmaster, SEDAC) commented
thanks for the suggestion, its actually on a list of items to do (provide sample code).
i can take a look at this a bit later on today. i'll try to get back to you today, if not tomorrow.
-
neil commented
I made a modification to use the SEDAS WMS as base layer but it doesn't work !!!
http://jsfiddle.net/qevWk/9/ -
Riny commented
I mean http://jsfiddle.net/qevWk/