No subject


Sun Apr 6 17:47:17 BST 2008


xtile = 2046
ytile = 1362

Also, as you suggested i tried to take the decimal part and determine how
much the tiles have to be moved:
X
2046.5533838222223
0.5533838222223 X 256 = 141.6 = 142 pixels

Y
1362.0441915021011
0.044191502101057267 * 256 = 11.31 = 11pixels

Is this calculation is according to what you have suggested?
The end result is not centering the map.

Regards,
Vishwa

On Wed, Apr 30, 2008 at 4:12 PM, root <john at mckerrell.net> wrote:

> If you convert the lat/lon to a floating point tile coordinate you can
> then use the decimal part to tell you how much you need to shift the
> tiles. Multiply it by 256 and that'll tell you how far. That help?
>
> On Wed, Apr 30, 2008 at 03:55:55PM +0530, Vishwa wrote:
> > i am doing this using C#.Net to create a image out of tiles, and i have
> to
> > center the image to the given image
> >
> > i know the zoom level, and the center coordianates, and the size of the
> 3x3
> > grid. how to center align the map when the center can be anywhere within
> the
> > 256x256 center tile?
> >
> > thanks
> > vishwa
> >
> >
> > > On Wed, Apr 30, 2008 at 1:15 PM, Iv??n S??nchez Ortega <
> > > ivan at sanchezortega.es> wrote:
> > >
> > > > El Mi??rcoles, 30 de Abril de 2008, Vishwa escribi??:
> > > > > In other words, how to know the pixel (x,y) *within the center
> tile*
> > > > for a
> > > > > given lon,lat value.
> > > >
> > > > If you're using javascript, please keep in mind that there are
> > > > OpenLayers
> > > > functions for this.
> > > >
> > > > --
> > > > ----------------------------------
> > > > Iv??n S??nchez Ortega <ivan at sanchezortega.es>
> > > >
> > > > "Anything that is too stupid to be spoken is sung."
> > > >  - Voltaire (1694-1778) [poor guy, never knew about rap]
> > > >
> > >
> > >
>
> > _______________________________________________
> > newbies mailing list
> > newbies at openstreetmap.org
> > http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/newbies
>
>
> _______________________________________________
> newbies mailing list
> newbies at openstreetmap.org
> http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/newbies
>

------=_Part_11107_24195950.1209731361041
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Sorry, it still not working.&nbsp; <br>Here are my values:<br><br>lon =&nbsp; -0.127144<br>lat&nbsp; = 51.506324999991364<br>zoom = 12<br><br>From which i calculate:<br>xtile = 2046<br>ytile = 1362<br><br>Also, as you suggested i tried to take the decimal part and determine how much the tiles have to be moved:<br>
X<br>2046.5533838222223<br>0.5533838222223 X 256 = 141.6 = 142 pixels<br><br>Y<br>1362.0441915021011 <br>0.044191502101057267 * 256 = 11.31 = 11pixels<br><br>Is this calculation is according to what you have suggested?<br>
The end result is not centering the map.<br><br>Regards,<br>Vishwa<br><br><div class="gmail_quote">On Wed, Apr 30, 2008 at 4:12 PM, root &lt;<a href="mailto:john at mckerrell.net">john at mckerrell.net</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
If you convert the lat/lon to a floating point tile coordinate you can<br>
then use the decimal part to tell you how much you need to shift the<br>
tiles. Multiply it by 256 and that&#39;ll tell you how far. That help?<br>
<div class="Ih2E3d"><br>
On Wed, Apr 30, 2008 at 03:55:55PM +0530, Vishwa wrote:<br>
&gt; i am doing this using C#.Net to create a image out of tiles, and i have to<br>
&gt; center the image to the given image<br>
&gt;<br>
&gt; i know the zoom level, and the center coordianates, and the size of the 3x3<br>
&gt; grid. how to center align the map when the center can be anywhere within the<br>
&gt; 256x256 center tile?<br>
&gt;<br>
&gt; thanks<br>
&gt; vishwa<br>
&gt;<br>
&gt;<br>
</div>&gt; &gt; On Wed, Apr 30, 2008 at 1:15 PM, Iv??n S??nchez Ortega &lt;<br>
&gt; &gt; <a href="mailto:ivan at sanchezortega.es">ivan at sanchezortega.es</a>&gt; wrote:<br>
&gt; &gt;<br>
&gt; &gt; &gt; El Mi??rcoles, 30 de Abril de 2008, Vishwa escribi??:<br>
<div class="Ih2E3d">&gt; &gt; &gt; &gt; In other words, how to know the pixel (x,y) *within the center tile*<br>
&gt; &gt; &gt; for a<br>
&gt; &gt; &gt; &gt; given lon,lat value.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; If you&#39;re using javascript, please keep in mind that there are<br>
&gt; &gt; &gt; OpenLayers<br>
&gt; &gt; &gt; functions for this.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; --<br>
&gt; &gt; &gt; ----------------------------------<br>
</div>&gt; &gt; &gt; Iv??n S??nchez Ortega &lt;<a href="mailto:ivan at sanchezortega.es">ivan at sanchezortega.es</a>&gt;<br>
<div class="Ih2E3d">&gt; &gt; &gt;<br>
&gt; &gt; &gt; &quot;Anything that is too stupid to be spoken is sung.&quot;<br>
&gt; &gt; &gt; &nbsp;- Voltaire (1694-1778) [poor guy, never knew about rap]<br>
&gt; &gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;<br>
<br>
</div>&gt; _______________________________________________<br>
&gt; newbies mailing list<br>
&gt; <a href="mailto:newbies at openstreetmap.org">newbies at openstreetmap.org</a><br>
&gt; <a href="http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/newbies" target="_blank">http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/newbies</a><br>
<br>
<br>
_______________________________________________<br>
newbies mailing list<br>
<a href="mailto:newbies at openstreetmap.org">newbies at openstreetmap.org</a><br>
<a href="http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/newbies" target="_blank">http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/newbies</a><br>
</blockquote></div><br>

------=_Part_11107_24195950.1209731361041--



More information about the newbies mailing list