[MapQuery] how to add an existing ol layer to mapquery

Volker Mische volker.mische at gmail.com
Tue May 15 11:21:29 EDT 2012


Hi Giuseppe,

On 05/15/2012 05:03 PM, Giuseppe De Marco wrote:
>> where do you actually initialise the new layer? 
> 
> in OpenLayers standard initialization. I created a simple WMS layer:
> 
>  pcn_orto_06_sm_tlch = new OpenLayers.Layer.WMS("Tilecache Difsuolo",
> "http://localhost/cgi-bin/tilecache.cgi", {'layers':
> "pcn_minambiente_ortofoto_2006_900913"}, {'projection': proj});

Ok, you should with the possible simplest thing you could do. Hard-code
as much as you can.

So your code for the new layer type should look like:

      existing_ol: function(options) {
            return {
                layer: new OpenLayers.Layer.WMS("Tilecache Difsuolo",
"http://localhost/cgi-bin/tilecache.cgi", {'layers':
"pcn_minambiente_ortofoto_2006_900913"}, {'projection': proj}),
                options: options
            };
        },

Initializes as:

jQuery('#map').data("mapQuery").layers({type: 'existing_ol"});

And see if it shows up. Go on from there (like passing in the hard-coded
layer as an option).

Cheers,
  Volker



More information about the MapQuery mailing list