Re: Display TMS from mapTiler in an offline AIR application

215 views
Skip to first unread message

hdam

unread,
Jan 16, 2013, 12:52:59 PM1/16/13
to opensca...@googlegroups.com
Hi,

I'm not familiar with 2.2, still using 1.2 where  but there is a TMS class is at org.openscales.core.layer.TMS.  You could do something like this to create a base map layer...

    var tmsLayer:TMS = new TMS("TMS", tileURL, "mapTiler ");  // tileURL should point to the "root" of your image tile
                                                                                            // e.g. http://localhost:8080/tiles/
                                                                                            // Tomcat ROOT directory should be structure like this
                                                                                            // tiles/1.0.0/mapTiler/... your tiles structure

    tmsLayer.minZoomLevel = 0;                       // whatever level that you want to set
    tmsLayer.maxZoomLevel = 12;                    // whatever level that you have data for
    tmsLayer.projSrsCode = "EPSG:4326";
    tmsLayer.map = map;                                // map is an instance of the Map class, see tutorial on how to create one.

    map.addLayer(tmsLayer, true, false);

 Good luck...

...-H
On Monday, January 14, 2013 10:34:55 AM UTC-5, Julien Yver wrote:

Hi everyone,


I develop an AIR application with a cartographic module. 

This cartographic module have to be offline.

I generate a TMS structure with mapTiler from a jpeg file, Geographic projection, WGS84 datum.

Now, I would like to display this files with openscales 2.2 but I really don't know how to do this and I didn't find any resources.

What is the best practice to do this in pure actionscript (best for me) or with flex?


Is there any tutorials or documentation to realize this? 

Is anyone already did this kind of work?


Thanks a lot for your help.


Regards.


Julien

Julien Yver

unread,
Jan 22, 2013, 4:35:10 AM1/22/13
to opensca...@googlegroups.com
HI hdam,

Thanks a lot for your help!
I had some problems to understand how works the tileURL with version+layername ...!
But that's it! I got it ;-)

Thanks again.

Julien

Ossi Rönnberg

unread,
May 16, 2013, 6:50:08 AM5/16/13
to opensca...@googlegroups.com
I recently made exactly this. Unfortunately I'm not able to share the codes as those are owned by the company.

But, what I can say is that it's not going to work straight out of the box like that.
You need to create a layer that handles tile requests to the database.

Here is an example how it's done with JavaScript. It's fairly simple to convert that to Actionscript.

I also used this SQLite library
https://github.com/probertson/air-sqlite

On Thursday, May 16, 2013 12:42:36 AM UTC+3, Peter Varga wrote:
Hi Julien,

Could you post your solution because now I try to load a tileMill export into openScale app.
Here is my code, but it doesn't work. 
            var tileURL:String = new File("Users/xy/assets/road-trip_a66ac9.mbtiles").url;
            var tmsLayer:TMS = new TMS("Road Trip", tileURL, "mapTiler")
            tmsLayer.format = "png";
             tmsLayer.maxExtent = new Bounds(-180,-85.05112877980659,180,85.05112877980659);
            _map.addLayer(tmsLayer,false);

Thanks
Peter

Peter Varga

unread,
May 16, 2013, 6:55:17 AM5/16/13
to opensca...@googlegroups.com
Hi thanks,

After I sent this email I started to work this solution. 
so thanks the resources to.
Peter

Mario Soares

unread,
Dec 9, 2013, 2:37:22 PM12/9/13
to opensca...@googlegroups.com
Hello!

I also can not run offline.

Can I get this version?

Thanks!

Email: mario...@gmail.com
Reply all
Reply to author
Forward
0 new messages