def getmapstaticcoords(lat,lon,zoom): from LatLonToMeters import LatLonToMeters from MetersToPixels import MetersToPixels from PixelsToMeters import PixelsToMeters from MetersToLatLon import MetersToLatLon mx,my = LatLonToMeters(lat,lon) pixel_x,pixel_y = MetersToPixels(mx,my,zoom) Ax = pixel_x-300 Ay = pixel_y + 300 Bx = pixel_x+300 By = pixel_y+300 Cx = pixel_x - 300 Cy = pixel_y - 300 Dx = pixel_x + 300 Dy = pixel_y - 300 mAx,mAy = PixelsToMeters(Ax,Ay,zoom) mBx,mBy = PixelsToMeters(Bx,By,zoom) mCx,mCy = PixelsToMeters(Cx,Cy,zoom) mDx,mDy = PixelsToMeters(Dx,Dy,zoom) latA,lonA = MetersToLatLon(mAx,mAy) latB,lonB = MetersToLatLon(mBx,mBy) latC,lonC = MetersToLatLon(mCx,mCy) latD,lonD = MetersToLatLon(mDx,mDy) latlen = abs(latA-latC) longlen = abs(lonA-lonD) return latlen,longlen