So nobody is interrested in my question in one day...
I show my PHP code, which is based on Mike's theory:
$sumx = $maxx-$minx; //geographical width
$midx = $minx+($maxx-$minx)/2; //geographical center
$sumy = $maxy-$miny; //geographical height
for($zx=21;$kepx<(($sumx*256)/360)*pow(2,$zx);$zx--) {} //check if
the image width (kepx) is fit to the width for the corresponding zoom
level
for($zy=21;$kepy<(($sumy*256)/170)*pow(2,$zy);$zy--) {} //check if
the image height (kepy) is fit to the height for the corresponding
zoom level
$z = min($zx,$zy)+1; //since the zx / zy value is decremented before
finshing the for cycle, we need to increment the smaller one to get
the zoom level.
Mike wrote in other topic, that we need to calculate with the cosine
of the latitude, but I don't understand, where exactly.
Maybe somebody?
thx.
On okt. 3, 20:11, HunGeri <[email protected]> wrote:
> Hello there,
> after a few days of browsing this huge group, I give up. I've found
> some solutions, some of them worked, others were useless for me. The
> goal would be:
> - I have a route (polyline), which I convert to encoded
> - There are some bus stops (markers) on the route
> - From these I have the bounding box, but without any calculating
> Static Maps shows me the content well, on the corresponding zoom level
> and centered for the content. So no problem at this point.
> But! Since this application is produced for mobile users, the map
> could be pretty small (I think, I will create the minimum size about
> at 120x160 pixels), so I would like to enable the users to zoom the
> content. After zooming they need paging as well to the four direction.
> For this function I need to know:
> - the center of the content (no problem)
> - the zoom level for the whole content
> - the LatLng size of the image on the actual zoom level (to step the
> center for paging).
>
> Could You help me? The algorythms I've found here are not similar to
> each other and ones are more complicated than the others. I've got
> almost the good results when I used Mike's two simple rows (360
> degrees are 256*(2^x), where x is the zoom level), but it fails
> sometimes one level...
--
You received this message because you are subscribed to the Google Groups
"Google Maps API V2" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-maps-api?hl=en.