<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 </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> jQuery('#map').data("mapQuery").layers({</div><div> type:'existing_ol',</div><div> label:'example',</div><div> legend:{url:'http://mapserver.edugis.nl/cgi-bin/mapserv?map=maps/edugis/cache/population.map&version=1.1.1&service=WMS&request=GetLegendGraphic&layer=Bevolkingsdichtheid_2010&format=image/png'},</div><div>
ol_layer:pcn_orto_06_sm_tlch,</div><div> min_zoom:2,</div><div> url:pcn_orto_06_sm_tlch.url,</div><div> layers:pcn_orto_06_sm_tlch.params.LAYERS,</div><div> });</div><div> }); </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 <volker.mische@gmail.com><br> <b><span style="font-weight: bold;">A:</span></b> Giuseppe De Marco <peppelinux@yahoo.it> <br><b><span style="font-weight: bold;">Cc:</span></b> "mapquery@lists.osgeo.org" <mapquery@lists.osgeo.org> <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> Volker<br><br>On 05/15/2012 04:07 PM, Giuseppe De Marco wrote:<br>> added in mapquery.core.js, at line
876:<br>> <br>> <js code><br>> /*<br>> example of initialization of an existing ol layer with mapquery:<br>> <br>> jQuery('#map').data("mapQuery").layers({<br>> type:'existing_ol',<br>> label:'Label that you prefer',<br>> <br>> legend:{url:'<a href="http://mapserver.edugis.nl/cgi-bin/mapserv?map=maps/edugis/cache/population.map&version=1.1.1&service=WMS&request=GetLegendGraphic&layer=Bevolkingsdichtheid_2010&format=image/png'" target="_blank">http://mapserver.edugis.nl/cgi-bin/mapserv?map=maps/edugis/cache/population.map&version=1.1.1&service=WMS&request=GetLegendGraphic&layer=Bevolkingsdichtheid_2010&format=image/png'</a>},<br>> ol_layer:osm, // its an new OpenLayer.Layer object name<br>>
});<br>> <br>> */<br>> existing_ol: function(options) {<br>> var o = $.extend(true, {}, $.fn.mapQuery.defaults.layer.all,<br>> $.fn.mapQuery.defaults.layer.raster,<br>> options);<br>> var params = {<br>> layers: options.ol_layer,<br>> transparent: o.transparent,<br>> format: o.format<br>> };<br>> if(typeof o.wms_parameters != "undefined"){<br>>
params = $.extend(params, o.wms_parameters);<br>> }<br>> return {<br>> layer: options.ol_layer,<br>> options: o<br>> };<br>> }, <br>> <br>> </js code><br>> <br>> it simply works,<br>> any suggestion?<br>> <br>> Thank you all<br>> g<br>> <br>> ------------------------------------------------------------------------<br>> *Da:* Volker Mische <<a ymailto="mailto:volker.mische@gmail.com" href="mailto:volker.mische@gmail.com">volker.mische@gmail.com</a>><br>> *A:* Giuseppe De Marco <<a ymailto="mailto:peppelinux@yahoo.it"
href="mailto:peppelinux@yahoo.it">peppelinux@yahoo.it</a>><br>> *Cc:* "<a ymailto="mailto:mapquery@lists.osgeo.org" href="mailto:mapquery@lists.osgeo.org">mapquery@lists.osgeo.org</a>" <<a ymailto="mailto:mapquery@lists.osgeo.org" href="mailto:mapquery@lists.osgeo.org">mapquery@lists.osgeo.org</a>><br>> *Inviato:* Marted́ 15 Maggio 2012 16:03<br>> *Oggetto:* Re: [MapQuery] how to add an existing ol layer to mapquery<br>> <br>> On 05/15/2012 03:41 PM, Giuseppe De Marco wrote:<br>>> I'm tryng to add an existing OL layer inside mapquery, without create it<br>>> with $.MapQuery.Layer.<br>>><br>>> Is it possibile without modify sources in 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>>
yournewlayertype: function(options) {<br>> // do some fancy stuff here<br>> return {<br>> layer: new OpenLayers.Layer.YourLayerType(),<br>> options: options<br>> };<br>> }<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>> Volker<br>> <br>> <br><br><br><br> </div> </div> </div></body></html>