Mapguide Tiles with OpenLayers

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Mapguide Tiles with OpenLayers

Greg
Looking for advice or sample using Mapguide tiles with OpenLayers.

Mapguide 3.1
OpenLayers 4.3.3

I have created a Tile Set Definition from the base layer. What is the best
way to access the tiles with OpenLayers?

I found this:  http://jsfiddle.net/ynaatpaq/ <http://jsfiddle.net/ynaatpaq/>  

Are there other samples or How to's?

Thanks,

Greg



--
Sent from: http://osgeo-org.1560.x6.nabble.com/MapGuide-Users-f4182607.html
_______________________________________________
mapguide-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapguide-users
Reply | Threaded
Open this post in threaded view
|

Re: Mapguide Tiles with OpenLayers

Jackie Ng
If the tile set is using the "Default" provider, just take that example and
replace the Map Definition resource id with your tile set resource id. You
still need to manually calculate MPU, scales, etc.

If the tile set is using the "XYZ" provider, you can just use ol.source.XYZ
and set it up with the same url template string from your linked example
(make sure the {x}, {y} and {z} placeholders are still there)

- Jackie



--
Sent from: http://osgeo-org.1560.x6.nabble.com/MapGuide-Users-f4182607.html
_______________________________________________
mapguide-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapguide-users
Reply | Threaded
Open this post in threaded view
|

Re: Mapguide Tiles with OpenLayers

maherich
I am wondering if this could be also somehow applicable to leaflet?



--
Sent from: http://osgeo-org.1560.x6.nabble.com/MapGuide-Users-f4182607.html
_______________________________________________
mapguide-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapguide-users
Reply | Threaded
Open this post in threaded view
|

Re: Mapguide Tiles with OpenLayers

Greg
In reply to this post by Jackie Ng
Jackie,

That works great.

Thank you.



--
Sent from: http://osgeo-org.1560.x6.nabble.com/MapGuide-Users-f4182607.html
_______________________________________________
mapguide-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapguide-users
Reply | Threaded
Open this post in threaded view
|

Re: Mapguide Tiles with OpenLayers

Jackie Ng
In reply to this post by maherich
If your tileset is using the XYZ provider, you can consume it in leaflet with
L.tileLayer

Your URL is your mapagent GETTILEIMAGE request, but use your tile set id as
the MAPDEFINITION and use {x} for TILEROW, {y} for TILECOL and {z} for
SCALEINDEX

For example:

L.tileLayer("http://yourmapguideserver/mapguide/mapagent/mapagent.fcgi?OPERATION=GETTILEIMAGE&VERSION=1.2.0&CLIENTAGENT=Leaflet&USERNAME=Anonymous&MAPDEFINITION=Library://Samples/Sheboygan/TileSets/SheboyganXYZ.TileSetDefinition&BASEMAPLAYERGROUPNAME=Base+Layer+Group&TILECOL={y}&TILEROW={x}&SCALEINDEX={z}")

- Jackie



--
Sent from: http://osgeo-org.1560.x6.nabble.com/MapGuide-Users-f4182607.html
_______________________________________________
mapguide-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapguide-users
Reply | Threaded
Open this post in threaded view
|

Re: Mapguide Tiles with OpenLayers

Bernhard Maehler
In OpenLayers 2 with Fusion there was an option to use HTTP tiles via the
​useHttpTile layer option.
This allows the map tiles to be proxied and cached, freeing up the MapGuide
Server process, and increases the performance.
Is this option also supported by OpenLayers 4 or mapguide-react-layout?
If not (as I assume), are there any alternatives except XYZ-tiles?
Currently, we can't use XYZ-tiles, because we need to display the map at
certain scales (1:100, 1:250, 1:500...) and other map projections (e.g. EPSG
25832).
I was thinking about using WMTS services which can be accessed by
OpenLayers, but this needs to setup another Map Server (e.g. GeoServer, UMN
MapServer) or other solutions like MapProxy.

Thanks,
Bernhard



--
Sent from: http://osgeo-org.1560.x6.nabble.com/MapGuide-Users-f4182607.html
_______________________________________________
mapguide-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapguide-users
Reply | Threaded
Open this post in threaded view
|

Re: Mapguide Tiles with OpenLayers

Jackie Ng
No, OL4 (and thus mapguide-react-layout) does not support the useHttpTile
option.

The MapGuide support in OL4 only concerns untiled maps. For tiled maps, you
can use the built-in ol.source.TileImage to consume MapGuide tiled maps.

If you are using a Tile Set Definition using the "Default" provider you can
specify the TilePath property to be a specific directory
(%MG_TILE_CACHE_PATH% just tells MapGuide to save rendered tiles to its
default configured directory), and then front Apache/nginx/etc to that
custom tile cache directory and then have your ol.source.TileImage point its
URL to that webserver URL instead of the mapagent.

Hope that helps.

- Jackie



--
Sent from: http://osgeo-org.1560.x6.nabble.com/MapGuide-Users-f4182607.html
_______________________________________________
mapguide-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapguide-users