Hi Daniel,

I have the same problem as you. I've looked through Matt's solution of your 
map2.js file, but for some reason it is still not working for me. Do you 
maybe have html and css file that were going with this? I would like to 
check if I'm missing something else.

Tnx,
Lovorka

Dana četvrtak, 12. ožujka 2015. u 15:21:59 UTC+1, korisnik Daniel Kelm 
napisao je:
>
> Hi Matt,
>
> thank you for your answer. It helps in a way but unfortunately I don't use 
> GeoJSON. I'd like to use the GetFeatureInfo directly from my WMS.
>
> So far I got the map and the layerswitcher running but when I try to 
> implement the GetFeatureInfo using a PopUp it failed, because its not a 
> GeoJSON.
>
> I've attached my *map2.js* . Maybe some of you is able to do a little 
> fix, so that it will work..? Thank you very much!
>
> Cheers,
> Daniel
>
> Am Dienstag, 3. März 2015 11:44:48 UTC+2 schrieb Matt Walker:
>>
>> Hi Daniel,
>>
>> I've been meaning to add a LayerSwitcher to the workshop we delivered 
>> last year at OSGIS in the UK: 
>> http://astuntechnology.github.io/osgis-ol3-leaflet/. I've now added it 
>> to the completed example and I'll follow up with the docs when a get the 
>> time. You can view the completed example which demonstrates GetFeatureInfo 
>> and the LayerSwticher here: 
>> http://astuntechnology.github.io/osgis-ol3-leaflet/ol3/ol3-complete.html, 
>> the source is here: 
>> https://github.com/AstunTechnology/osgis-ol3-leaflet/blob/master/ol3/ol3-complete.js
>> .
>>
>> Hope that helps,
>>
>> Matt.
>>
>> On Wednesday, 25 February 2015 03:58:25 UTC, Javier Muñoz wrote:
>>>
>>> Hey Matt! You need to use ol.layer.Imagen and then ol.layer.ImageWMS. 
>>> Example:
>>>
>>>       /* Sectores de la Comuna de Curico */
>>>       var cbcWMS1 = new ol.source.ImageWMS({
>>>         url: 'http://localhost:7070/geoserver/CuerpoBomberosCurico/wms',
>>>         params: {
>>>           'LAYERS': 'SectoresComunaCurico'
>>>         }
>>>       });
>>>
>>>       /* Areas de Despacho de Curicó */
>>>       var cbcWMS2 = new ol.source.ImageWMS({
>>>         url: 'http://localhost:7070/geoserver/CuerpoBomberosCurico/wms',
>>>         params: {
>>>           'LAYERS': 'AreasDespacho'
>>>         }
>>>       });
>>>
>>>       var sectores = new ol.layer.Image({
>>>                       title: 'Sectores de Curicó',
>>>                       source: cbcWMS1
>>>                     });
>>>       var despachos = new ol.layer.Image({
>>>                       title: 'Áreas de Despacho',
>>>                       source: cbcWMS2
>>>                     });
>>>
>>>       var capaWMS = new ol.layer.Group({
>>>                 title: 'Capas WMS',
>>>                 layers: [sectores, despachos]
>>>             });
>>>
>>>
>>> Regards!
>>>
>>> El miércoles, 18 de febrero de 2015, 10:43:20 (UTC-4), Daniel Kelm 
>>> escribió:
>>>>
>>>> I'm working on a webmapping project which use geoserver and OpenLayers 
>>>> 3 for the vizualisation. I'm stuck when I try to use "WMS GetFeatureInfo" 
>>>> and "LayerSwitcher". Both functions work individually but when I try to 
>>>> combine both it doesn't work anymore. I'm sure I'm on the right way but 
>>>> missing something...
>>>>
>>>> For the GetFeatureInfo I use code like in this example:
>>>> http://openlayers.org/en/v3.0.0/examples/getfeatureinfo-tile.html
>>>>
>>>> and for the LayerSwitcher I have implemented this: 
>>>> https://github.com/walkermatt/ol3-layerswitcher
>>>>
>>>> I'm not able to merge both, to a working code.
>>>>
>>>>       <div id="map" class="map"></div>
>>>>
>>>>       
>>>>
>>>>       <script>
>>>>
>>>>           
>>>>
>>>>             var view = new ol.View({
>>>>
>>>>             center: [1450000, 6809000],
>>>>
>>>>             zoom: 12
>>>>
>>>>             });
>>>>
>>>>           
>>>>
>>>>             var viewProjection = /** @type {ol.proj.Projection} */
>>>>
>>>>             (view.getProjection());
>>>>
>>>>        
>>>>
>>>>             var map = new ol.Map({
>>>>
>>>>                 target: 'map',
>>>>
>>>>                 layers: [
>>>>
>>>>                     new ol.layer.Group({
>>>>
>>>>                         'title': 'Base maps',
>>>>
>>>>                         layers: [
>>>>
>>>>                             new ol.layer.Tile({
>>>>
>>>>                                 title: 'OSM',
>>>>
>>>>                                 type: 'base',
>>>>
>>>>                                 visible: true,
>>>>
>>>>                                 source: new ol.source.OSM()
>>>>
>>>>                             })
>>>>
>>>>                         ]
>>>>
>>>>                     }),
>>>>
>>>>                     new ol.layer.Group({
>>>>
>>>>                         title: 'Overlays',
>>>>
>>>>                         layers: [
>>>>
>>>>                             new ol.layer.Tile({
>>>>
>>>>                                 title: 'FFH',
>>>>
>>>>                                 source: new ol.source.TileWMS({
>>>>
>>>>                                     url: '
>>>> http://141.64.68.176/geoserver/wms?',
>>>>
>>>>                                     params: {'LAYERS': 
>>>> 'jueterbog:fl_ffh'},
>>>>
>>>>                                     serverType: 'geoserver'
>>>>
>>>>                                 })
>>>>
>>>>                             }),
>>>>
>>>>                             new ol.layer.Tile({
>>>>
>>>>                                 title: 'SPA',
>>>>
>>>>                                 source: new ol.source.TileWMS({
>>>>
>>>>                                     url: '
>>>> http://141.64.68.176/geoserver/wms?',
>>>>
>>>>                                     params: {'LAYERS': 
>>>> 'jueterbog:fl_spa'},
>>>>
>>>>                                     serverType: 'geoserver'
>>>>
>>>>                                 })
>>>>
>>>>                             })
>>>>
>>>>                         ]
>>>>
>>>>                     })
>>>>
>>>>                 ],
>>>>
>>>>                 view: view
>>>>
>>>>             });
>>>>
>>>>             
>>>>
>>>>           
>>>>
>>>>           // LayerSwitcher
>>>>
>>>>             var layerSwitcher = new ol.control.LayerSwitcher({
>>>>
>>>>                 tipLabel: 'Legende' // Optional label for button
>>>>
>>>>             });
>>>>
>>>>             map.addControl(layerSwitcher);
>>>>
>>>>
>>>>
>>>>         
>>>>
>>>>       </script>
>>>>
>>>>       
>>>>
>>>>               <div class="span4 offset4">
>>>>
>>>>           <div id="info" class="alert alert-success">
>>>>
>>>>             &nbsp;
>>>>
>>>>           </div>
>>>>
>>>>         </div>
>>>>
>>>

-- 
You received this message because you are subscribed to the Google Groups "OL3 
Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/ol3-dev.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ol3-dev/4720c1e7-b884-4cee-9cfc-08548e4d2513%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to