<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>added in mapquery.core.js, at line 876:</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>&lt;js code&gt;</span></div><div><span><div>/*</div><div>example of initialization of an existing ol layer with mapquery:</div><div><br></div><div>&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:'Label that you prefer',</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:osm, // its an new OpenLayer.Layer object name</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; });</div><div><br></div><div>&nbsp;*/</div><div>&nbsp; &nbsp; &nbsp; &nbsp; existing_ol: function(options) {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var o = $.extend(true, {}, $.fn.mapQuery.defaults.layer.all,</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $.fn.mapQuery.defaults.layer.raster,</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; options);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var params = {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; layers:
 options.ol_layer,</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; transparent: o.transparent,</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; format: o.format</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; };</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(typeof o.wms_parameters != "undefined"){</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; params = $.extend(params, o.wms_parameters);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; layer: options.ol_layer,</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; options: o</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; };</div><div>&nbsp; &nbsp; &nbsp; &nbsp; }, &nbsp; &nbsp; &nbsp; &nbsp;</div></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; ">&lt;/js code&gt;</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; ">it simply works,</div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; ">any suggestion?</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; ">Thank you all</div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; ">g</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:03<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>On 05/15/2012 03:41 PM, Giuseppe De Marco wrote:<br>&gt; I'm tryng to add an existing OL layer inside mapquery, without create it<br>&gt; with $.MapQuery.Layer.<br>&gt; <br>&gt; Is it possibile without modify sources in&nbsp; jquery.mapquery.core.js ?<br><br>Hi Giuseppe,<br><br>the best way
 would be to add a new layer type. You would do something<br>like (just somewhere within your app):<br><br>$.extend($.MapQuery.Layer.types, {<br>&nbsp; &nbsp; yournewlayertype: function(options) {<br>&nbsp; &nbsp; &nbsp; &nbsp; // do some fancy stuff here<br>&nbsp; &nbsp; &nbsp; &nbsp; return {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; layer: new OpenLayers.Layer.YourLayerType(),<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; options: options<br>&nbsp; &nbsp; &nbsp; &nbsp; };<br>&nbsp; &nbsp; }<br>});<br><br>Then you can add a new layer to your MapQuery map with:<br>mq.layers({type: 'yournewlayertupe'});<br><br>It's just like the layer definitions for the layers that are already<br>defined in the ore. I hope you get the idea.<br><br>Cheers,<br>&nbsp; Volker<br><br><br> </div> </div>  </div></body></html>