Quantcast

Use of MBTIles with openlayers

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Use of MBTIles with openlayers

robertdbuckley
Hi,

Has anyone successfully used MBTiles to server basemaps in Openlayers?
Do any live example exist if yes?

yours,

Rob

_______________________________________________
Users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/openlayers-users
Yours with thanks, Robert Buckley System: Linux Ubuntu 10.04 Server / Tomcat6 / Geoserver 2.1.2 / GeoWebCache 1.2.6)
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Use of MBTIles with openlayers

jrom
Hi Robert,

You can do this through the OpenLayers.Layer.XYZ() class with some
code server side to mimic a standard XYZ grid.
I've done this within the mapshup framework (http://mapshup.info).

Server side, you need to create a script that converts XYZ requests to
mbtiles requests.
See http://code.google.com/p/mapshup/source/browse/server/utilities/mbtsrv.php
for an example of this script.

Suppose that you access this script on http://localhost/mbtsrv.php,
you should set your layer like this client side :

var newLayer = new OpenLayers.Layer.XYZ("mbtile",
'http://localhost/mptsrv.php', {isBaseLayer:true});

Regards

Jerome

--
http://mapshup.info

2012/1/25 Robert Buckley <[hidden email]>:

> Hi,
>
> Has anyone successfully used MBTiles to server basemaps in Openlayers?
> Do any live example exist if yes?
>
> yours,
>
> Rob
>
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/openlayers-users
>
_______________________________________________
Users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/openlayers-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Use of MBTIles with openlayers

Greg Allensworth
In reply to this post by robertdbuckley
On 1/25/2012 4:18 AM, Robert Buckley wrote:
> Has anyone successfully used MBTiles to server
> basemaps in Openlayers? Do any live example exist if yes?

You need server-side software to open the MBTiles file and fetch the
tiles. TileStache and TileStream are two popular servers for doing this.

TileStache is Python and I found it fairly easy to set up. It runs under
Apache as CGI, mod_python, or WSGI. If you have an existing web server
and web content, this is probably the easiest way to go.

TileStream is written in Node JS and takes a bit more setup. It does not
run under Apache, but is its own server with its own service port and it
has some behaviors regarding the hostname of incoming requests --
running it on port 80 with your other web content is not simple.

--
Greg Allensworth, Web GIS Developer
BS  A+  Network+  Security+  Linux+  Server+
GreenInfo Network - Information and Mapping in the Public Interest
564 Market Street, Suite 510  San Francisco CA 94104
PH: 415-979-0343 x302  FX: 415-979-0371    email: [hidden email]
Web: www.GreenInfo.org     www.MapsPortal.org

Subscribe to MapLines, our e-newsletter, at www.GreenInfo.org
_______________________________________________
Users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/openlayers-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Use of MBTIles with openlayers

robertdbuckley
Thanks for the reply,

So TileStache can serve and render the MBTiles to use with openlayers? Would you know if there are possibilities for exporting mapcontent from the openlayers mappanel?

This is one of the reasons i´m looking in this directory as I can´t do pdf exports with geowebcache served from geoserver.

Thanks,

Rob


Von: Greg Allensworth <[hidden email]>
An: Robert Buckley <[hidden email]>
Cc: "[hidden email]" <[hidden email]>
Gesendet: 17:51 Mittwoch, 25.Januar 2012
Betreff: Re: [OpenLayers-Users] Use of MBTIles with openlayers

On 1/25/2012 4:18 AM, Robert Buckley wrote:
> Has anyone successfully used MBTiles to server
> basemaps in Openlayers? Do any live example exist if yes?

You need server-side software to open the MBTiles file and fetch the tiles. TileStache and TileStream are two popular servers for doing this.

TileStache is Python and I found it fairly easy to set up. It runs under Apache as CGI, mod_python, or WSGI. If you have an existing web server and web content, this is probably the easiest way to go.

TileStream is written in Node JS and takes a bit more setup. It does not run under Apache, but is its own server with its own service port and it has some behaviors regarding the hostname of incoming requests -- running it on port 80 with your other web content is not simple.

-- Greg Allensworth, Web GIS Developer
BS  A+  Network+  Security+  Linux+  Server+
GreenInfo Network - Information and Mapping in the Public Interest
564 Market Street, Suite 510  San Francisco CA 94104
PH: 415-979-0343 x302  FX: 415-979-0371    email: [hidden email]
Web: www.GreenInfo.org    www.MapsPortal.org

Subscribe to MapLines, our e-newsletter, at www.GreenInfo.org



_______________________________________________
Users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/openlayers-users
Yours with thanks, Robert Buckley System: Linux Ubuntu 10.04 Server / Tomcat6 / Geoserver 2.1.2 / GeoWebCache 1.2.6)
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Use of MBTIles with openlayers

ramotswa
I suspect you might have the same problem. We have solved this by
calling the appropriate WMS layer from the geoserver to do the print
request. The problem with any tiled base approach is that either you
have to cut down the tile parts that run outside of your export area,
or you have to go to the closest tile, which at lower resolutions is
quite a big geographical distance.

Regards,
Toby

On 25 January 2012 16:58, Robert Buckley <[hidden email]> wrote:

> Thanks for the reply,
>
> So TileStache can serve and render the MBTiles to use with openlayers? Would
> you know if there are possibilities for exporting mapcontent from the
> openlayers mappanel?
>
> This is one of the reasons i´m looking in this directory as I can´t do pdf
> exports with geowebcache served from geoserver.
>
> Thanks,
>
> Rob
>
> ________________________________
> Von: Greg Allensworth <[hidden email]>
> An: Robert Buckley <[hidden email]>
> Cc: "[hidden email]" <[hidden email]>
> Gesendet: 17:51 Mittwoch, 25.Januar 2012
> Betreff: Re: [OpenLayers-Users] Use of MBTIles with openlayers
>
> On 1/25/2012 4:18 AM, Robert Buckley wrote:
>> Has anyone successfully used MBTiles to server
>> basemaps in Openlayers? Do any live example exist if yes?
>
> You need server-side software to open the MBTiles file and fetch the tiles.
> TileStache and TileStream are two popular servers for doing this.
>
> TileStache is Python and I found it fairly easy to set up. It runs under
> Apache as CGI, mod_python, or WSGI. If you have an existing web server and
> web content, this is probably the easiest way to go.
>
> TileStream is written in Node JS and takes a bit more setup. It does not run
> under Apache, but is its own server with its own service port and it has
> some behaviors regarding the hostname of incoming requests -- running it on
> port 80 with your other web content is not simple.
>
> -- Greg Allensworth, Web GIS Developer
> BS  A+  Network+  Security+  Linux+  Server+
> GreenInfo Network - Information and Mapping in the Public Interest
> 564 Market Street, Suite 510  San Francisco CA 94104
> PH: 415-979-0343 x302  FX: 415-979-0371    email: [hidden email]
> Web: www.GreenInfo.org    www.MapsPortal.org
>
> Subscribe to MapLines, our e-newsletter, at www.GreenInfo.org
>
>
>
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/openlayers-users
>
_______________________________________________
Users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/openlayers-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Use of MBTIles with openlayers

Greg Allensworth
In reply to this post by robertdbuckley
On 1/25/2012 8:58 AM, Robert Buckley wrote:
> So TileStache can serve and render the
 > MBTiles to use with openlayers?

Correct. http://tilestache.org/doc/TileStache.MBTiles.html

It can serve up an existing MBTiles file. But according to the docs, it
will not save tiles to a MBTiles file -- you need an existing MBTiles
file, or can use tilestache-seed to create one.


> Would you know if there are possibilities for exporting
> mapcontent from the openlayers mappanel?
> This is one of the reasons i´m looking in this directory as
> I can´t do pdf exports with geowebcache served from geoserver.

This seems independent of your MBTiles question. TileStache and other
map servers probably won't get involved with loading the content of your
map and then creating a PDF.

Check out some of the resources here:
    http://trac.osgeo.org/openlayers/wiki/Printing

Our current favorite method is wkhtmltopdf. You basically write a new
page using JavaScript and OpenLayers as usual, have it set the map's
zoom and center and basemap -- so that when the page opens it's showing
exactly the map you want. Dump the HTML to a file, have wkhtmltopdf
convert the HTML file to a PDF (yes, wkhtmltopdf speaks JavaScript, even
jQuery, Bing Maps, and OpenLayers). Really slick.

--
Greg Allensworth, Web GIS Developer
BS  A+  Network+  Security+  Linux+  Server+
GreenInfo Network - Information and Mapping in the Public Interest
564 Market Street, Suite 510  San Francisco CA 94104
PH: 415-979-0343 x302  FX: 415-979-0371    email: [hidden email]
Web: www.GreenInfo.org     www.MapsPortal.org

Subscribe to MapLines, our e-newsletter, at www.GreenInfo.org
_______________________________________________
Users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/openlayers-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Use of MBTIles with openlayers

robertdbuckley
In reply to this post by ramotswa
Thanks Tobias.

I remember your forum post from November last year...


"...So to get this working, you might be able add quite a simple loop.
In your printprovider.js in line 367 there is a loop to populate the
json object with the layers that you are wanting to get printed.
So onto line 369 add:
if (layer.url == "http://maps.zgb.de/geoserver/gwc/service/wms"){
layer.url = "http://maps.zgb.de/geoserver/zgb/wms")
else
{}

(untested code, probably missing ;'s and other stuff!)...

Toby.

..."

This never did work for me....and I decided to enjoy christmas and start the whole thing again in 2012. Unfortunately we are already in 2012 and the niggly little jobs which I need to solve have appeared again!

If you have time to help me crack this one I´d be much appreciated.  ps..i´m located in D-31822.

yours,

Rob



Von: Tobias Reinicke <[hidden email]>
An: Robert Buckley <[hidden email]>
Cc: Greg Allensworth <[hidden email]>; "[hidden email]" <[hidden email]>
Gesendet: 18:04 Mittwoch, 25.Januar 2012
Betreff: Re: [OpenLayers-Users] Use of MBTIles with openlayers

I suspect you might have the same problem. We have solved this by
calling the appropriate WMS layer from the geoserver to do the print
request. The problem with any tiled base approach is that either you
have to cut down the tile parts that run outside of your export area,
or you have to go to the closest tile, which at lower resolutions is
quite a big geographical distance.

Regards,
Toby

On 25 January 2012 16:58, Robert Buckley <[hidden email]> wrote:

> Thanks for the reply,
>
> So TileStache can serve and render the MBTiles to use with openlayers? Would
> you know if there are possibilities for exporting mapcontent from the
> openlayers mappanel?
>
> This is one of the reasons i´m looking in this directory as I can´t do pdf
> exports with geowebcache served from geoserver.
>
> Thanks,
>
> Rob
>
> ________________________________
> Von: Greg Allensworth <[hidden email]>
> An: Robert Buckley <[hidden email]>
> Cc: "[hidden email]" <[hidden email]>
> Gesendet: 17:51 Mittwoch, 25.Januar 2012
> Betreff: Re: [OpenLayers-Users] Use of MBTIles with openlayers
>
> On 1/25/2012 4:18 AM, Robert Buckley wrote:
>> Has anyone successfully used MBTiles to server
>> basemaps in Openlayers? Do any live example exist if yes?
>
> You need server-side software to open the MBTiles file and fetch the tiles.
> TileStache and TileStream are two popular servers for doing this.
>
> TileStache is Python and I found it fairly easy to set up. It runs under
> Apache as CGI, mod_python, or WSGI. If you have an existing web server and
> web content, this is probably the easiest way to go.
>
> TileStream is written in Node JS and takes a bit more setup. It does not run
> under Apache, but is its own server with its own service port and it has
> some behaviors regarding the hostname of incoming requests -- running it on
> port 80 with your other web content is not simple.
>
> -- Greg Allensworth, Web GIS Developer
> BS  A+  Network+  Security+  Linux+  Server+
> GreenInfo Network - Information and Mapping in the Public Interest
> 564 Market Street, Suite 510  San Francisco CA 94104
> PH: 415-979-0343 x302  FX: 415-979-0371    email: [hidden email]
> Web: www.GreenInfo.org    www.MapsPortal.org
>
> Subscribe to MapLines, our e-newsletter, at www.GreenInfo.org
>
>
>
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/openlayers-users
>



_______________________________________________
Users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/openlayers-users
Yours with thanks, Robert Buckley System: Linux Ubuntu 10.04 Server / Tomcat6 / Geoserver 2.1.2 / GeoWebCache 1.2.6)
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Use of MBTIles with openlayers

Tac Tacelosky
In reply to this post by jrom
Wow, what a cool tool!   Am I correct in my (brief) reading of the license that it is more permissive than GPL?  


I have a client that needs a map to integrate with some of our tools, although I'm guessing that I'd be able to do this without actually modifying the mashup code, simply configuring the widgets and search, etc.

The license mentions "External Modules".  Is their documentation or a mailing list for developing those?

Thanks, and thanks again for a great tool, is it on the OpenLayers example page somewhere? (http://openlayers.org/dev/examples/)  It's a great site for showcasing OpenLayers' capabilities.

Tac 

On Wed, Jan 25, 2012 at 9:28 AM, jrom <[hidden email]> wrote:
Hi Robert,

You can do this through the OpenLayers.Layer.XYZ() class with some
code server side to mimic a standard XYZ grid.
I've done this within the mapshup framework (http://mapshup.info).

Server side, you need to create a script that converts XYZ requests to
mbtiles requests.
See http://code.google.com/p/mapshup/source/browse/server/utilities/mbtsrv.php
for an example of this script.

Suppose that you access this script on http://localhost/mbtsrv.php,
you should set your layer like this client side :

var newLayer = new OpenLayers.Layer.XYZ("mbtile",
'http://localhost/mptsrv.php', {isBaseLayer:true});

Regards

Jerome

--
http://mapshup.info

2012/1/25 Robert Buckley <[hidden email]>:
> Hi,
>
> Has anyone successfully used MBTiles to server basemaps in Openlayers?
> Do any live example exist if yes?
>
> yours,
>
> Rob
>
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/openlayers-users
>
_______________________________________________
Users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/openlayers-users


_______________________________________________
Users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/openlayers-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Use of MBTIles with openlayers

jrom
Hi Tac !

2012/1/25 Tac Tacelosky <[hidden email]>:
> Wow, what a cool tool!   Am I correct in my (brief) reading of the license
> that it is more permissive than GPL?
>
> http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html

I really appreciate that you like this application :)
Yes the license is more permissive than GPL. It can be compared to the
BSD license : you can do what you want with the code without giving
back the modifications to the community. The main difference with BSD
is that you need to expressively mention mapshup in your software -
let the mapshup logo within the map for example.

> I have a client that needs a map to integrate with some of our tools,
> although I'm guessing that I'd be able to do this without actually modifying
> the mashup code, simply configuring the widgets and search, etc.
> The license mentions "External Modules".  Is their documentation or a
> mailing list for developing those?

It's a very generic licence so "External Modules" do not refer
specifically to mapshup. However the application architecture is based
on a "plugin" approach to allow people to develop their own
functionality. Unfortunately i had no time yet to write documentation
so for the moment you need to look at the code to understand how it
works.
To have some idea about what you can by configuration, you should look
at the default configuration file
(http://code.google.com/p/mapshup/source/browse/client/js/mapshup/config/default.js).

I'm preparing some minimal documentation to explain how the tool works
and how you can configure/modify it to suits your needs.
For example, there are some hidden functionalities that are not
visible at first sight :
 - you should try to drag&drop an url on the map (WMS, WFS, GeoRSS) or
a file (GeoJSON, JPEG with GPS information stored in EXIF, etc.)
 - when you click for more than 200ms on the map, a popup menu appears

> Thanks, and thanks again for a great tool, is it on the OpenLayers example
> page somewhere? (http://openlayers.org/dev/examples/)  It's a great site for
> showcasing OpenLayers' capabilities.

I think that the examples page is dedicated to OpenLayers examples
only and not to "OpenLayers based application".
But i'll be pleased to showcase OpenLayers capabilities through mapshup !

Regards

Jerome

>
> Tac
>
> On Wed, Jan 25, 2012 at 9:28 AM, jrom <[hidden email]> wrote:
>>
>> Hi Robert,
>>
>> You can do this through the OpenLayers.Layer.XYZ() class with some
>> code server side to mimic a standard XYZ grid.
>> I've done this within the mapshup framework (http://mapshup.info).
>>
>> Server side, you need to create a script that converts XYZ requests to
>> mbtiles requests.
>> See
>> http://code.google.com/p/mapshup/source/browse/server/utilities/mbtsrv.php
>> for an example of this script.
>>
>> Suppose that you access this script on http://localhost/mbtsrv.php,
>> you should set your layer like this client side :
>>
>> var newLayer = new OpenLayers.Layer.XYZ("mbtile",
>> 'http://localhost/mptsrv.php', {isBaseLayer:true});
>>
>> Regards
>>
>> Jerome
>>
>> --
>> http://mapshup.info
>>
>> 2012/1/25 Robert Buckley <[hidden email]>:
>> > Hi,
>> >
>> > Has anyone successfully used MBTiles to server basemaps in Openlayers?
>> > Do any live example exist if yes?
>> >
>> > yours,
>> >
>> > Rob
>> >
>> > _______________________________________________
>> > Users mailing list
>> > [hidden email]
>> > http://lists.osgeo.org/mailman/listinfo/openlayers-users
>> >
>> _______________________________________________
>> Users mailing list
>> [hidden email]
>> http://lists.osgeo.org/mailman/listinfo/openlayers-users
>
>



--
http://jrom.info
_______________________________________________
Users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/openlayers-users
Loading...