<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; "><span>You're right Volker,</span></div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; "><span><br></span></div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; "><span>it was a dummy examples,</span></div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; "><span>I'm playng with a local WMS and now I'm in trouble with two things:</span></div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; "><span><br></span></div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; "><span>1. The layer initialize with 0 opacity</span></div><div style="font-family: 'times new
 roman', 'new york', times, serif; font-size: 12pt; "><span>2. when map zoom change the ol_layer doesn't update&nbsp;</span></div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; "><span><br></span></div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; ">I'm playing with:</div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; "><br></div><div><div>&nbsp; &nbsp; &nbsp; &nbsp; jQuery('#map').data("mapQuery").layers({</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; type:'existing_ol',</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; label:'example',</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; legend:{url:'http://mapserver.edugis.nl/cgi-bin/mapserv?map=maps/edugis/cache/population.map&amp;version=1.1.1&amp;service=WMS&amp;request=GetLegendGraphic&amp;layer=Bevolkingsdichtheid_2010&amp;format=image/png'},</div><div>&nbsp; &nbsp;
 &nbsp; &nbsp; &nbsp; &nbsp; ol_layer:pcn_orto_06_sm_tlch,</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; min_zoom:2,</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; url:pcn_orto_06_sm_tlch.url,</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; layers:pcn_orto_06_sm_tlch.params.LAYERS,</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; });</div><div>&nbsp; &nbsp; &nbsp; &nbsp; });&nbsp;</div></div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; "><span><br></span></div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; "><br></div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; "><span><br></span></div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; "><br></div>  <div style="font-size: 12pt; font-family: 'times new roman', 'new york', times, serif; "> <div style="font-size: 12pt; font-family:
 'times new roman', 'new york', times, serif; "> <div dir="ltr"> <font size="2" face="Arial"> <hr size="1">  <b><span style="font-weight:bold;">Da:</span></b> Volker Mische &lt;volker.mische@gmail.com&gt;<br> <b><span style="font-weight: bold;">A:</span></b> Giuseppe De Marco &lt;peppelinux@yahoo.it&gt; <br><b><span style="font-weight: bold;">Cc:</span></b> "mapquery@lists.osgeo.org" &lt;mapquery@lists.osgeo.org&gt; <br> <b><span style="font-weight: bold;">Inviato:</span></b> Marted́ 15 Maggio 2012 16:23<br> <b><span style="font-weight: bold;">Oggetto:</span></b> Re: [MapQuery] how to add an existing ol layer to mapquery<br> </font> </div> <br>Hi Giuseppe,<br><br>where do you actually initialise the new layer? Is it already<br>initialised in ol_layer? It looks a bit strange that you use a WMS bit<br>have a Layer names osm.<br><br>Cheers,<br>&nbsp; Volker<br><br>On 05/15/2012 04:07 PM, Giuseppe De Marco wrote:<br>&gt; added in mapquery.core.js, at line
 876:<br>&gt; <br>&gt; &lt;js code&gt;<br>&gt; /*<br>&gt; example of initialization of an existing ol layer with mapquery:<br>&gt; <br>&gt;&nbsp; &nbsp;  jQuery('#map').data("mapQuery").layers({<br>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  type:'existing_ol',<br>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  label:'Label that you prefer',<br>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br>&gt; legend:{url:'<a href="http://mapserver.edugis.nl/cgi-bin/mapserv?map=maps/edugis/cache/population.map&amp;version=1.1.1&amp;service=WMS&amp;request=GetLegendGraphic&amp;layer=Bevolkingsdichtheid_2010&amp;format=image/png'" target="_blank">http://mapserver.edugis.nl/cgi-bin/mapserv?map=maps/edugis/cache/population.map&amp;version=1.1.1&amp;service=WMS&amp;request=GetLegendGraphic&amp;layer=Bevolkingsdichtheid_2010&amp;format=image/png'</a>},<br>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  ol_layer:osm, // its an new OpenLayer.Layer object name<br>&gt;&nbsp;
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  });<br>&gt; <br>&gt;&nbsp; */<br>&gt;&nbsp; &nbsp; &nbsp; &nbsp;  existing_ol: function(options) {<br>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  var o = $.extend(true, {}, $.fn.mapQuery.defaults.layer.all,<br>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  $.fn.mapQuery.defaults.layer.raster,<br>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  options);<br>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  var params = {<br>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  layers: options.ol_layer,<br>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  transparent: o.transparent,<br>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  format: o.format<br>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  };<br>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  if(typeof o.wms_parameters != "undefined"){<br>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
 &nbsp; &nbsp; &nbsp;  params = $.extend(params, o.wms_parameters);<br>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  }<br>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  return {<br>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  layer: options.ol_layer,<br>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  options: o<br>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  };<br>&gt;&nbsp; &nbsp; &nbsp; &nbsp;  },&nbsp; &nbsp; &nbsp; &nbsp; <br>&gt; <br>&gt; &lt;/js code&gt;<br>&gt; <br>&gt; it simply works,<br>&gt; any suggestion?<br>&gt; <br>&gt; Thank you all<br>&gt; g<br>&gt; <br>&gt; ------------------------------------------------------------------------<br>&gt; *Da:* Volker Mische &lt;<a ymailto="mailto:volker.mische@gmail.com" href="mailto:volker.mische@gmail.com">volker.mische@gmail.com</a>&gt;<br>&gt; *A:* Giuseppe De Marco &lt;<a ymailto="mailto:peppelinux@yahoo.it"
 href="mailto:peppelinux@yahoo.it">peppelinux@yahoo.it</a>&gt;<br>&gt; *Cc:* "<a ymailto="mailto:mapquery@lists.osgeo.org" href="mailto:mapquery@lists.osgeo.org">mapquery@lists.osgeo.org</a>" &lt;<a ymailto="mailto:mapquery@lists.osgeo.org" href="mailto:mapquery@lists.osgeo.org">mapquery@lists.osgeo.org</a>&gt;<br>&gt; *Inviato:* Marted́ 15 Maggio 2012 16:03<br>&gt; *Oggetto:* Re: [MapQuery] how to add an existing ol layer to mapquery<br>&gt; <br>&gt; On 05/15/2012 03:41 PM, Giuseppe De Marco wrote:<br>&gt;&gt; I'm tryng to add an existing OL layer inside mapquery, without create it<br>&gt;&gt; with $.MapQuery.Layer.<br>&gt;&gt;<br>&gt;&gt; Is it possibile without modify sources in&nbsp; jquery.mapquery.core.js ?<br>&gt; <br>&gt; Hi Giuseppe,<br>&gt; <br>&gt; the best way would be to add a new layer type. You would do something<br>&gt; like (just somewhere within your app):<br>&gt; <br>&gt; $.extend($.MapQuery.Layer.types, {<br>&gt;&nbsp; &nbsp; 
 yournewlayertype: function(options) {<br>&gt;&nbsp; &nbsp; &nbsp; &nbsp;  // do some fancy stuff here<br>&gt;&nbsp; &nbsp; &nbsp; &nbsp;  return {<br>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  layer: new OpenLayers.Layer.YourLayerType(),<br>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  options: options<br>&gt;&nbsp; &nbsp; &nbsp; &nbsp;  };<br>&gt;&nbsp; &nbsp;  }<br>&gt; });<br>&gt; <br>&gt; Then you can add a new layer to your MapQuery map with:<br>&gt; mq.layers({type: 'yournewlayertupe'});<br>&gt; <br>&gt; It's just like the layer definitions for the layers that are already<br>&gt; defined in the ore. I hope you get the idea.<br>&gt; <br>&gt; Cheers,<br>&gt;&nbsp;  Volker<br>&gt; <br>&gt; <br><br><br><br> </div> </div>  </div></body></html>