[MapQuery] proj4js and other projection systems
Drew Wells
drew.wells00 at gmail.com
Fri Jul 22 17:26:09 EDT 2011
Have you tried doing a load on that projection by itself first prior to
using it? Normally Projections are loaded via async call instead of
directly putting it in the code like this. It may need to process it prior
to OpenLayers using it. Just do 'new Proj4js.Proj("EPSG:26914")'. Also
check that there aren't 404 requests in your Firebug/webkit console.
There's a bug in Proj4js related to initial loading of projections, I put a
patch in but probably hasn't gotten out to the downloads page yet.
-Drew
On Fri, Jul 22, 2011 at 5:20 PM, Justin Penka <jpenka at sdrmaps.com> wrote:
> Hello all,****
>
> ** **
>
> Been playing with the new mapquery today and thus far really enjoying
> working with it. One thing im getting hung up on is the proj4js projection
> stuff. I been banging my head against this for a while so it’s most likely
> something simple that im overlooking. Anyway I basically modified the
> existing demo code and have been trying to use a UTM projection with no
> luck. Does anyone see something obvious in this code that im doing wrong?*
> ***
>
> ** **
>
> <!doctype html>****
>
> <html>****
>
> <head>****
>
> <meta name="viewport" content="width=device-width, user-scalable=no,
> initial-scale=1.0, maximum-scale=1.0;">****
>
> <meta name="apple-mobile-web-app-capable" content="yes">****
>
> <title>MapQuery WMS other projection example</title>****
>
> <link rel='StyleSheet' type='text/css' href='style/style.css'/> ****
>
> <script src="../lib/openlayers/OpenLayers.js"
> type="text/javascript"></script>****
>
> <script src="../lib/jquery/jquery-1.4.4.js"
> type="text/javascript"></script>****
>
> <script src="../src/jquery.mapquery.core.js"
> type="text/javascript"></script>****
>
> <script type="text/javascript" src="
> http://proj4js.org/lib/proj4js-combined.js"></script> <!--You need to
> include proj4js if you use different coordinate systems, TODO: smo 20110614
> do this automatically?-->****
>
> ** **
>
> <script type="text/javascript">****
>
> $(document).ready(function() {****
>
> Proj4js.defs["EPSG:26914"] = "+title=NAD83 / UTM zone 14N +proj=utm
> +zone=14 +ellps=GRS80 +datum=NAD83 +units=m +no_defs";****
>
> ** **
>
> //initialise mapquery with a non-spherical mercator WMS ****
>
> var map = $('#map').mapQuery({****
>
> maxExtent:[683998,3742974,731202,3785937], // im assuming that
> this is the extent of the layer as defined in the 26914 proj system****
>
> projection:'EPSG:26914', ****
>
> layers:[{****
>
> type:'wms',****
>
> projection:'EPSG:26914', ****
>
> url:'
> http://dweb81.h0st1le.webfactional.com/lovecounty/map/ogcserver',****
>
> layers:'fire_boundaries',****
>
> format: 'image/png'****
>
> }]****
>
> }).data('mapQuery'); // we directly get the
> mapQuery map object to be able to set the initial extent ****
>
> map.goto({box:[102, 15, -96, 81]}); // we zoom to a
> area defined as a box in wgs84 (long/lat) ****
>
> });****
>
> </script>****
>
> </head>****
>
> <body>****
>
> <div id="map" class="map"></div>****
>
> </body>****
>
> </html>****
>
> _______________________________________________
> 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/20110722/d11f38e0/attachment.html
More information about the MapQuery
mailing list