[MapQuery] proj4js and other projection systems
Justin Penka
jpenka at sdrmaps.com
Fri Jul 22 17:20:51 EDT 2011
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>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapquery/attachments/20110722/8436b7af/attachment.html
More information about the MapQuery
mailing list