hack the MapBoxSource gxp plugin to allow for our tilestream data

Bug #1157219 reported by Ben Wyss
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenQuake Platform
Fix Committed
Undecided
Ben Wyss

Bug Description

Create a new custom gxp plugin that will allow one to connect to a local tilestream server and render in openlayers a mbtiles tileset.

This hack with begin by duplicating and then modifying the MapBoxSource gxp plugin: http://gxp.opengeo.org/master/doc/lib/plugins/MapBoxSource.html

also see:

http://suite.opengeo.org/opengeo-docs/apps/plugincreate/action.html

and

http://dev.openlayers.org/docs/files/OpenLayers/Layer/TMS-js.html#OpenLayers.Layer.TMS.tileOrigin

Revision history for this message
Ben Wyss (bmwyss) wrote :

By replacing the var configs with my own layer info, I am changing mapbox.com with my tilestream server address, and serviceVersion with 'v2'. It nearly works, but the tiles are not lining up. I have tried a number of different tileOrigin options without success. It is not clear to me why they are using -128 * 156543.03390625, -128 * 156543.03390625 instead of 20037504?

Changed in openquake:
status: New → In Progress
assignee: nobody → Ben Wyss (bmwyss)
Revision history for this message
Ben Wyss (bmwyss) wrote :

I am serving the tilesets with tilestream, which uses V2, Openlayers.Layer.TMS can only support tiles being server from version 1.0.0. So, I need to instead use OpenLayers.Layer.XYZ as it supports tiles servered with v2. My code ended up like so:

layers[i] = new OpenLayers.Layer.XYZ(

                "hazard_map_points_world",
                [
                "http://<myTileStreamServer>:8000/v2/hazard_map_points_world/${z}/${x}/${y}.png"
                ],
                {
        attribution: "Tiles &copy; <a href='http://mapbox.com/'>MapBox</a>",
        sphericalMercator: true,
        wrapDateLine: true,
        numZoomLevels: 7,
        serverResolutions: [
                156543.03390625, 78271.516953125, 39135.7584765625,
                19567.87923828125, 9783.939619140625, 4891.9698095703125,
                2445.9849047851562, 1222.9924523925781, 611.4962261962891,
                305.74811309814453, 152.87405654907226, 76.43702827453613,
                38.218514137268066, 19.109257068634033, 9.554628534317017,
                4.777314267158508, 2.388657133579254, 1.194328566789627,
                0.5971642833948135
            ],
    }

Ben Wyss (bmwyss)
Changed in openquake:
status: In Progress → Confirmed
Revision history for this message
Ben Wyss (bmwyss) wrote :

The plugin also needs to be used by the geo-explorer, to do so the plugin needs to be added into the minified gxp.js, and referenced in the /etc/geonode/local_settings.py

Revision history for this message
Ben Wyss (bmwyss) wrote :
Changed in openquake:
status: Confirmed → Fix Committed
Changed in oq-platform:
status: New → Fix Committed
milestone: none → 1.13.0
assignee: nobody → Ben Wyss (bmwyss)
Ben Wyss (bmwyss)
no longer affects: openquake
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related blueprints

Remote bug watches

Bug watches keep track of this bug in other bug trackers.