Skip to content

Instantly share code, notes, and snippets.

@emoen
Last active August 29, 2015 14:00
Show Gist options
  • Save emoen/11249020 to your computer and use it in GitHub Desktop.
Save emoen/11249020 to your computer and use it in GitHub Desktop.
OLRecord = gxp.plugins.OLSource.prototype.createLayerRecord({
source: "ol",
type: "OpenLayers.Layer.WMS",
group: "${bilde.gruppe}",
queryable: true,
visibility: !(app.id > 0) ? ${bilde.visible} : false,
properties: "mareano_wmslayerpanel",
args: [
"${kartlaget.title}",
"${kartlaget.url}",
{layers: "${kartlaget.layers}", format: "image/png", transparent: true},
{
opacity: 1,
metadata: {
keyword: "${kartlaget.keyword}",
'kartlagId': '${kartlaget.id}'
},
minScale: ${kartlaget.scalemax}*(96/0.0254),
maxScale: (${kartlaget.scalemin} > 0) ? ${kartlaget.scalemin}*(96/0.0254) : 0.001,
units: "m",
maxExtent: [
${kartlaget.exGeographicBoundingBoxWestBoundLongitude},
${kartlaget.exGeographicBoundingBoxSouthBoundLatitude},
${kartlaget.exGeographicBoundingBoxEastBoundLongitude},
${kartlaget.exGeographicBoundingBoxNorthBoundLatitude}
],
singleTile:true,
buffer: 0, //getting no boarder around image - so panning will get a new image.
ratio: 1 //http://dev.openlayers.org/releases/OpenLayers-2.12/doc/apidocs/files/OpenLayers/Layer/Grid-js.html#OpenLayers.Layer.Grid.ratio
}
]
});
layers.push(OLRecord);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment