I: [MapQuery] how to add an existing ol layer to mapquery
Volker Mische
volker.mische at gmail.com
Wed May 16 05:48:53 EDT 2012
Hi Giuseppe,
great to hear that it worked. Could you try to put it into your
JavaScript file instead of patching jquery.mapquery.core.js? You would
add there (and include it after jquery.mapquery.core.js):
$.extend($.MapQuery.Layer.types, {
existing_ol: ...
});
Just to make sure it works. People shouldn't need to patch the core if
they want to add new layer types.
Cheers,
Volker
On 05/15/2012 10:16 PM, Giuseppe De Marco wrote:
>
> Thank you Volker,
>
> I was hang in on my foolish brain loop, as world teaches to us the
> answer is always much simple respect what we thought...
>
> I simply add in jquery.mapquery.core.js, at line 892:
>
> existing_ol: function(options) {
> //alert(67);
> o = $.extend(true, {}, $.fn.mapQuery.defaults.layer.all,
> $.fn.mapQuery.defaults.layer.raster,
> options);
> params = {
> //layers: o.layers,
> layers: options.ol_layer,
> transparent: o.transparent,
> format: o.format
> };
> if(typeof o.wms_parameters != "undefined"){
> params = $.extend(params, o.wms_parameters);
> }
> //alert('ytu');
> return {
> //layer: options.ol_layer,
> layer: new OpenLayers.Layer.WMS(o.label, o.url, params, o),
> options: o,
> };
> },
>
> and then I added to the created ol_layers two parameters, 'visibility':
> true and 'opacity': 1, as the example above:
>
> pcn_orto_06_sm_tlch = new OpenLayers.Layer.WMS("Tilecache Difsuolo",
> "http://localhost/cgi-bin/tilecache.cgi", {'layers':
> "pcn_minambiente_ortofoto_2006_900913", 'visibility': true, 'opacity':
> 1,}, {'projection': proj});
>
> That's all,
> it works all the way.
> Thank you all, mapquery is a very smart idea
>
>
>
>
>
>
> _______________________________________________
> MapQuery mailing list
> MapQuery at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapquery
More information about the MapQuery
mailing list