Bonjour,

Je voudrais savoir si certain(e)s d'entre vous connaisse le static map de google?
http://maps.google.com/staticmap?center=42.714728,-1.998672&zoom=2&size=400x400&maptype=mobile&key=MAPS_API_KEY
Qui consiste a retourner l'image correspondante aux coordonnées GPS et zoom définit dans l'adresse.

En fait mon probleme est que j'essaye de rendre possible le parcours de la carte en entier
C'est a dire que j'appelle la première carte qui est centré sur latitude1 longitude1qui est une image de 100x100px je veux a partir d'ici convertir mes 100px en latitude, et pour ça j'ai trouvé ce calcul :

[code=java]
function Adjust(X,Y,x,y,z,pixel)
{
var offset=268435456;
var radius=offset/Math.PI;
function LToX(x)
{
return Math.round(offset+radius*x*Math.PI/180);
}
function LToY(y)
{
return Math.round(offset-radius*Math.log((1+Math.sin(y*Math.PI/180))/(1-Math.sin(y*Math.PI/180)))/2);
}
function XToL(x)
{
return ((Math.round(x)-offset)/radius)*180/Math.PI;
}
function YToL(y)
{
return (Math.PI/2-2*Math.atan(Math.exp((Math.round(y)-offset)/radius)))*180/Math.PI;
}
if (pixel)
return {x:(LToX(X)-LToX(x))>>(21-z),y:(LToY(Y)-LToY(y))>>(21-z)};
else
return {x:XToL(LToX(x)+(X<<(21-z))),y:YToL(LToY(y)+(Y<<(21-z)))};
}
function XYToLL(X,Y,x,y,z){return Adjust(X,Y,x,y,z,0);}
function LLToXY(X,Y,x,y,z){return Adjust(X,Y,x,y,z,1);}
[/code]
Puisque je fais celui la :
[code=java]
publicdouble[] adjust(double lat, double lng, int deltaX, int deltaY, int z)
{
returnnewdouble[]{
XToL(LToX(lat) + (deltaX<<(21-z))),
YToL(LToY(lng) + (deltaY<<(21-z)))
};
}
double LToX(double x)
{
return round(offset + radius * x * Math.PI / 180);
}
double LToY(double y)
{
return round(
offset - radius *
Double.longBitsToDouble(MicroDouble.log(
Double.doubleToLongBits(
(1 + Math.sin(y * Math.PI / 180))
/
(1 - Math.sin(y * Math.PI / 180))
)
)) / 2);
}
double XToL(double x)
{
return((round(x) - offset) / radius) * 180 / Math.PI;
}
double YToL(double y)
{
return(Math.PI / 2 - 2 * Double.longBitsToDouble(
MicroDouble.atan(
MicroDouble.exp(Double.doubleToLongBits((round(y)-offset)/radius))
)
)) * 180 / Math.PI;
}
double round(double num)
{
double floor = Math.floor(num);
if(num - floor >= 0.5)
returnMath.ceil(num);
else
return floor;
}
[/code]
Un peu long je vous l'accorde
En tout cas j'ai un probleme de justesse du calcul, c'est à que les coordonnées retournées ne sont
pas exactement les bonnes....... décalage de
quelques pixels au gran
d maximum
, mais ça fais tache...
La preuve:

Voila, en tout cas merci de m'avoir lu jusqu'ici ^^
Quelqu'un a t-il une idée? ou quelqu'un connait une autre façon de faire?
Merci beaucoup ;)