Thanks for your help.<br>Diego I try this:<br><br> function showAddress(address) {<br> var geocoder = new GClientGeocoder();<br> if (geocoder) {<br> geocoder.getLatLng(<br> address,<br> function(point) {<br>
if (!point) {alert(address + " not found");}<br> else {map.setCenter(OpenLayers.Layer.SphericalMercator.forwardMercator(point.x,point.y),15)}<br> }<br> );<br> }<br> }<br>
<br>And thats Works. Thanks!<br><br><br><div class="gmail_quote">2008/7/3 Paul Spencer <<a href="mailto:pagameba@gmail.com">pagameba@gmail.com</a>>:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Try this:<br>
<br>
var mapProj = new OpenLayers.Projection('EPSG:900913');<br>
var userProj = new OpenLayers.Projection('EPSG:4326');<div class="Ih2E3d"><br>
<br>
function showAddress(address) {<br>
var geocoder = new GClientGeocoder();<br>
if (geocoder) {<br>
geocoder.getLatLng(<br>
address,<br>
function(point) {<br>
if (!point) {<br>
alert(address + " not found");<br>
} else {<br></div>
var ll = new OpenLayers.LonLat(point.x,point.y);<br>
ll.transform(userProj, mapProj);<br>
map.setCenter(ll,15);<br>
}<br>
}<br>
);<br>
}<br>
}<br>
<br>
Cheers<br><font color="#888888">
<br>
Paul</font><div><div></div><div class="Wj3C7c"><br>
<br>
On 3-Jul-08, at 8:07 AM, David Martinez Morata wrote:<br>
<br>
</div></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div class="Wj3C7c">
Hello.<br>
I have a problem with geocoding.<br>
<br>
I have a function to do it, but the problem its the result. I geocode and the result it's in EPSG:4326 projection but mi map it's in EPSG:900913. I try to put the transform function of OpenLayers.LonLat object but I'm doing somthing wrong.<br>
My function it's:<br>
<br>
<br>
function showAddress(address) {<br>
var geocoder = new GClientGeocoder();<br>
if (geocoder) {<br>
geocoder.getLatLng(<br>
address,<br>
function(point) {<br>
if (!point) {alert(address + " not found");}<br>
else {map.setCenter(new OpenLayers.LonLat(point.x,point.y),15)}<br>
}<br>
);<br>
}<br>
}<br>
<br>
Anyone can help me?<br>
<br>
Thanks<br></div></div><div class="Ih2E3d">
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@openlayers.org" target="_blank">Users@openlayers.org</a><br>
<a href="http://openlayers.org/mailman/listinfo/users" target="_blank">http://openlayers.org/mailman/listinfo/users</a><br>
</div></blockquote>
<br>
</blockquote></div><br>