[mapserver-users] maptiles displaying out of order.

Hishan Melanga hishanm at gmail.com
Sat Jun 1 18:46:43 PDT 2013


Thank you yvecai that was the problem. Now it is working like a charm.


On Sat, Jun 1, 2013 at 9:45 PM, <yvecai at gmail.com> wrote:

> It may be that your server use TMS tile numbering instead of
> OSM/Google/.... so Y coordinate is upside-down.
>
> public final class TMSTileSource extends OnlineTileSourceBase {
>
>     public TMSTileSource(final String aName, final
> org.osmdroid.ResourceProxy.string aResourceId, final int aZoomMinLevel,
>                     final int aZoomMaxLevel, final int aTileSizePixels,
> final String aImageFilenameEnding,
>                     final String... aBaseUrl) {
>             super(aName, aResourceId, aZoomMinLevel, aZoomMaxLevel,
> aTileSizePixels,
>                             aImageFilenameEnding, aBaseUrl);
>     }
>
>     @Override
>     public String getTileURLString(final MapTile aTile) {
>             int z = aTile.getZoomLevel();
>             int y = aTile.getY();
>             int x = aTile.getX();
>             int yy= (int) (Math.pow(2,z) -y-1);
>             return getBaseUrl() + z + "/" + x + "/" + yy
>                             + mImageFilenameEnding;
>     }
> }
>
>
> On Saturday, June 1, 2013 3:12:47 PM UTC+2, Hishan Melanga wrote:
>
>> The problem with this image is that the tiles are reversed from top to
>> bottom. I meant that the tile that should be in the top is in the bottom.
>> How can I fix this?
>>
>>
>> On Sat, Jun 1, 2013 at 3:12 PM, Hishan Melanga <his... at gmail.com> wrote:
>>
>>>
>>> I have implemented a tiles server using Mapcache. I am retrieving tiles
>>> from that server using the following link,
>>>
>>>
>>> http://192.168.1.5/mapcache/**tms/1.0.0/ms-base@**GoogleMapsCompatible/<http://192.168.1.5/mapcache/tms/1.0.0/ms-base@GoogleMapsCompatible/>
>>>
>>> How ever when osmdroid mapview display the tiles it comes out of order.
>>> I attached  an image for you to see. How can I get rid of this problem?
>>> --
>>> හිෂාන් මෙලංග | Hishan Melanga <http://hishanmelanga.blogspot.com/>
>>>
>>
>>
>>
>> --
>> හිෂාන් මෙලංග | Hishan Melanga <http://hishanmelanga.blogspot.com/>
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "osmdroid" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to osmdroid+unsubscribe at googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>



-- 
හිෂාන් මෙලංග | Hishan Melanga <http://hishanmelanga.blogspot.com/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20130602/15fb6f94/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: device-2013-06-02-071341.png
Type: image/png
Size: 16069 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20130602/15fb6f94/attachment.png>


More information about the MapServer-users mailing list