It looks like you are trying to re-project Google raster layers?<br><br>I thought OpenLayers was only capable of re-projecting vector layers?<br><br>For example, the following article uses OpenLayers (& Proj4JS) to re-project KML and GeoRSS data (geographic coords, WGS84) to a number of different projections (Mollweide, Behrmann, etc):<br>
<br><a href="http://www.geowebguru.com/articles/209-how-to-create-an-online-map-with-a-non-mercator-projection-part-2">http://www.geowebguru.com/articles/209-how-to-create-an-online-map-with-a-non-mercator-projection-part-2</a><br>
<br><br>Richard Marsden<br>Winwaed Software Technology LLC<br><a href="http://www.winwaed.com">http://www.winwaed.com</a><br><a href="http://www.mapping-tools.com">http://www.mapping-tools.com</a><br><a href="http://www.geowebguruc.om">http://www.geowebguruc.om</a><br>
<br><br><div class="gmail_quote">On Thu, Nov 19, 2009 at 12:12 PM, Dash <span dir="ltr"><<a href="mailto:jimlug@co.clackamas.or.us">jimlug@co.clackamas.or.us</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
Aloha Thursday folks,<br>
<br>
I am banging my head against the problem for the last several hours. I have<br>
went through numerous examples and utilized OpenLayers tutorial on<br>
reprojecting points without any success. I've even used the Proj4js Wiki<br>
without any help. Could some please shed some light on what I am doing<br>
wrong?<br>
<br>
Here is the scenario. I am trying to transform some coordinates from<br>
EPSG:2913 to EPSG:900913. I've also tried a simplified version using<br>
EPSG:4326 -> EPSG:900913. Anyway, the transform is not happening for some<br>
odd reason. I do have the proj4js library within my code and I have added<br>
EPSG definition to my /proj4js/lib/def directory. I am checking if the<br>
projection by using the getUnits function of the projection class within<br>
OpenLayers. If the units come back null, then the proj4js library is<br>
unavailable. Why is this? I'm so confused. This should be rather straight<br>
forward. Anyway, here is some of my code. Hopefully someone can help me<br>
out. Thanks.<br>
<br>
<head><br>
<script src="<a href="http://openlayers.org/dev/lib/OpenLayers.js" target="_blank">http://openlayers.org/dev/lib/OpenLayers.js</a>"<br>
type="text/javascript"></script><br>
<script src="./proj4js/lib/proj4js.js"></script><br>
<script src="proj4js/lib/defs/EPSG2913.js"></script><br>
<script src="proj4js/lib/defs/EPSG900913.js"></script><br>
<script src="proj4js/lib/defs/EPSG4326.js"></script><br>
</head><br>
<br>
<script type="text/javascript"><br>
var map;<br>
function init(){<br>
var options = {<br>
//projection: new OpenLayers.Projection("EPSG:900913"), // Map projection<br>
projection: "EPSG:900913",<br>
displayProjection: new OpenLayers.Projection("EPSG:4326"), // Display<br>
projection<br>
units: "m",<br>
numZoomLevels: 5,<br>
maxResolution: 156543.0339,<br>
maxExtent: new OpenLayers.Bounds(-13698618.8209569, 5595988.4768255,<br>
-13521569.8682338, 5701506.49106001)<br>
};<br>
<br>
// Initiate Map Controls<br>
map.addControl(new OpenLayers.Control.LayerSwitcher());<br>
map.addControl(new OpenLayers.Control.MousePosition());<br>
<br>
// Create Google Mercator Layers<br>
var gmap = new OpenLayers.Layer.Google("Google<br>
Streets",{'sphericalMercator': true, numZoomLevels: 20});<br>
var gphy = new OpenLayers.Layer.Google("Google Physical",<br>
{'sphericalMercator': true, type: G_PHYSICAL_MAP, numZoomLevels: 20});<br>
var gsat = new OpenLayers.Layer.Google("Google<br>
Satellite",{'sphericalMercator': true, type: G_SATELLITE_MAP, numZoomLevels:<br>
20});<br>
var ghyb = new OpenLayers.Layer.Google("Google<br>
Hybrid",{'sphericalMercator': true, type: G_HYBRID_MAP, numZoomLevels: 20});<br>
<br>
map.addLayers([gmap, gphy, gsat, ghyb]);<br>
<br>
var srcProj = new OpenLayers.Projection("EPSG:4326");<br>
alert(srcProj.getUnits());<br>
var point = new OpenLayers.LonLat(-71, 42);<br>
point.transform(srcProj, map.getProjectionObject());<br>
<br>
if(point.transformed)<br>
{<br>
alert("point already transformed");<br>
}<br>
<br>
Proj4js.transform(srcProj, map.getProjectionObject(), point);<br>
<br>
Any suggestions would be greatly appreciated. THANKS...<br>
<font color="#888888">--<br>
View this message in context: <a href="http://n2.nabble.com/transform-help-please-tp4033462p4033462.html" target="_blank">http://n2.nabble.com/transform-help-please-tp4033462p4033462.html</a><br>
Sent from the OpenLayers Users mailing list archive at Nabble.com.<br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@openlayers.org">Users@openlayers.org</a><br>
<a href="http://openlayers.org/mailman/listinfo/users" target="_blank">http://openlayers.org/mailman/listinfo/users</a><br>
</font></blockquote></div><br>