[MapQuery] WMS layered on Bing, OSM, etc.

R. Paul Warriner warrinerr at orchardparkny.org
Tue Jul 19 09:53:39 EDT 2011


Hello Steven,

 

Thank you for the pointer. 

 

It worked great once I re-projected from PostGIS. ArcInfo was giving very
bad results.

http://gis.orchardparkny.org/opcarto/mapquery/demo/index_op_900913.html

 

Best Always,

Paul

 

 

----------------------------------------------------------------------------
----------------------------------------------------------------------------
-------------------------------------------

Hi Paul,

 

Since OSM and BING are both in Spherical Mercator projection and MapQuery
(nor the browser) can reproject images, the WMS has to be in spherical
mercator as well. It is possible to combine oms, bing and WMS, if they are
in spherical mercator, see: 

http://mapquery.org/demo/widgets/mqLayerManager.html

If you zoom in you will see the Population_Density WMS appear, and you can
click on 'Add Bing aerial' to add the Bing layer.

 

Your WMS:

 

             {

 

                type:'wms',

 

                label:'Parcels',

 

                url:'http://gis.orchardparkny.org/cgi-bin/opopen.540',

 

                layers:'parcel_poly_2008_4326'

 

             }

 

Looks like an unprojected WGS84 (EPSG:4326) layer. This will not fit, you
could use a reprojecting tilecache like MapProxy to convert from that WMS to
Spherical Mercator or (even better) add support for Spherical Mercator to
your WMS and use that.

 

Steven

 

 

Op 7/11/2011 3:41 PM, R. Paul Warriner schreef:

> 

> Hello Folks,

> 

> Sorry to waste bandwidth, but this stuff is like chocolate. J "Go 

> Steven!!"

> 

> I know the project is at an early stage in development, and I am 

> pushing it, but if I can throw a quick non-developer question out.

> 

> I am curious if it is possible to overlay WMS onto one of the base 

> layers (OSM, Bing, etc.) at this point?

> 

> Code block 1:

> 

> http://gis.orchardparkny.org/opcarto/mapquery/demo/index_op_bing.html

> 

> Code block 2 (below):

> 

> http://gis.orchardparkny.org/opcarto/mapquery/demo/index_op_wms.html

> 

> Code Block 1:

> 

> <script type="text/javascript">

> 

>     $(document).ready(function() {

> 

>     //initialise mapquery with a non-spherical mercator WMS

> 

>     var map = $('#map').mapQuery({

> 

>         layers:[{

> 

>                type:'bing',

> 

>                key:'ourkey',

> 

>                label:'Bing'

> 

>             },

> 

>             {

> 

>                type:'wms',

> 

>                label:'Parcels',

> 

>                url:'http://gis.orchardparkny.org/cgi-bin/opopen.540',

> 

>                layers:'parcel_poly_2008_4326'

> 

>             }

> 

> ]

> 

>         }).data('mapQuery');

> 

>     map.goto({

> 

>          box:[-78.798293, 42.695841, -78.696733, 42.811194],

> 

>     });

> 

>     $('#overview').mqOverviewMap({

> 

>         map: '#map'

> 

>         });

> 

>     $('.zoom').mqZoomButtons({

> 

>         map:'#map',

> 

>         home: true

> 

>         });

> 

>     $('#zoomslider').mqZoomSlider({

> 

>         map:'#map'

> 

>         });

> 

>     $('#layermanager').mqLayerManager({map:'#map'});

> 

>     $('#mouseposition').mqMousePosition({

> 

>         map:'#map',

> 

>         x:'lon',

> 

>         y:'lat',

> 

>         precision:4

> 

>         });

> 

>     });

> 

> </script>

> 

> Code Block 2:

> 

> <script type="text/javascript">

> 

>     $(document).ready(function() {

> 

>     Proj4js.defs["EPSG:4326"] = "+proj=longlat +ellps=WGS84

> +datum=WGS84 +no_defs ";

> 

>     //initialise mapquery with a non-spherical mercator WMS

> 

>     var map = $('#map').mapQuery({

> 

>         maxExtent:[-79.7600, 42.0000, -77.3700, 43.6400],

> 

>         projection:'EPSG:4326',

> 

>         layers:[{

> 

>                type:'bing',

> 

>                key:'ourkey',

> 

>                label:'Bing'

> 

>             },

> 

>             {

> 

>                type:'wms',

> 

>                label:'Parcels',

> 

>                url:'http://gis.orchardparkny.org/cgi-bin/opopen.540',

> 

>                layers:'parcel_poly_2008_4326'

> 

>             }

> 

> ]

> 

>         }).data('mapQuery');

> 

>     map.goto({

> 

>          box:[-78.798293, 42.695841, -78.696733, 42.811194],

> 

>     });

> 

>    $('#overview').mqOverviewMap({

> 

>         map: '#map'

> 

>         });

> 

>     $('.zoom').mqZoomButtons({

> 

>         map:'#map',

> 

>         home: true

> 

>         });

> 

>     $('#zoomslider').mqZoomSlider({

> 

>         map:'#map'

> 

>         });

> 

>     $('#layermanager').mqLayerManager({map:'#map'});

> 

>     $('#mouseposition').mqMousePosition({

> 

>         map:'#map',

> 

>         x:'lon',

> 

>         y:'lat',

> 

>         precision:4

> 

>         });

> 

>     });

> 

> </script>

> 

> Best Always,

> 

> Paul

> 

> /R. //Paul Warriner/

> 

> /Network Coordinator/

> 

> /Town of Orchard Park/

> 

> /4295 S Buffalo St/

> 

> /Orchard Park, NY 14127/

> 

> /716.662.6403/

> 

> opit at orchardparkny.org <mailto:warrinerr at orchardparkny.org>

> 

> //

> 

> 

> 

> _______________________________________________

> MapQuery mailing list

> MapQuery at lists.osgeo.org

> http://lists.osgeo.org/mailman/listinfo/mapquery

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapquery/attachments/20110719/f587109d/attachment-0001.html


More information about the MapQuery mailing list