Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Has anyone done this with georeferenced images and the openlayers module? If so, can you provide some insight on how it's done?
example: http://geo.nls.uk/maps/towns/aberdeen/openlayers.html
Comment | File | Size | Author |
---|---|---|---|
#24 | maptiler-enabled.png | 151.68 KB | KrisBulman |
Comments
Comment #1
zzolo CreditAttribution: zzolo commentedHi Kris,
I am not sure if our TMS layer will provide all the functionality you need, but you can always implement the layer_type and layer hooks to create what you need. Check out the examples provided in the module.
--
zzolo
Comment #2
tmcw CreditAttribution: tmcw commentedThe TMS and OSM layer types are sufficient for this kind of application, but that's only a small part of the puzzle if you're looking to create new implementations. The OpenLayers module is only the display part of the equation. What's the other 90% is the tools to warp maps - there are new-age versions like Map Warper, Cartagen Knitter, and then there are somewhat old-age versions like using ArcGIS or QGIS with rubber-sheeting to make the composite images, and then using GeoServer or TileCache to serve the maps.
Comment #3
KrisBulman CreditAttribution: KrisBulman commentedI have the maps georeferenced and warped already, via QGIS and MapTiler/GDAL2tiles. I am able to get them to display in openlayers, a google maps implementation and in a KML file that displays on Google Earth... but NOT in the Drupal module.
Here are the existing examples: (not very warped)
http://96.45.180.228/lots_33-34_meachams/openlayers.html
http://96.45.180.228/lots_33-34_meachams/googlemaps.html
http://96.45.180.228/0682/doc.kml
I've attempted to use the KML feature in your module as a layer with the proper layer name, but no layer shows up. If I use tilecache, can anyone tell me what config options to use for an image overlay? I'm sure I can pull the data out of the existing examples to plug in there.. but I haven't had any luck creating a TMS layer pointing to something like http://96.45.180.228/tilecache-2.10/tilecache.cgi and when I do, the OpenLayers module seems to try to display the TMS layer as a base map, and not just an overlay.
We're attempting this at the University of Prince Edward Island, and have over 1000 historical maps scanned (some are even 10 meters long). We're very eager to get them displaying in our platforms of choice. (OpenLayers/Drupal)
Comment #4
tmcw CreditAttribution: tmcw commentedSo the whole tiles-in-KML thing isn't really an option (and shouldn't be... it's kind of BS on a technical level). So this isn't working as a TMS layer? The TileCache URL that you noted seems to be down, so there's no way of testing against that.
It looks like MapWarper uses its own getTilesURL function for tiles, so it couldn't really be supported off-the-bat, but that may be incorrect - the getTilesURL function could be very similar to an existing scheme. Regardless, I'll look into it. And, yes, it's on the backlog to unify baselayers and overlays so that TMS layers can be used as overlays without messing around with code.
Comment #5
KrisBulman CreditAttribution: KrisBulman commentedI've updated the link to the tilecache cgi
http://96.45.180.228/tilecache-2.10/tilecache.cgi
The map I am testing is http://96.45.180.228/0682/openlayers.html
map info:
The PNG is http://96.45.180.228/0682/0682.png
The dimensions are: 6648px wide & 3981px high
from openlayers.html:
var mapBounds = new OpenLayers.Bounds( -63.3050189462, 46.347611308, -62.9175059265, 46.4602909498);
var mapMinZoom = 9;
var mapMaxZoom = 14;
The tilecache examples, state:
I've modified my config to:
the URL to my test map is: http://theming.bulman.ca/worldmap
In the module, I've set this up as a TMS layer, with http://96.45.180.228/tilecache-2.10/tilecache.cgi as the URL and layer name is "meachams"
Clearly, it's not working, although it does appear to be contacting my server as I see the IP in the viewer appear.. but the scale is way off, and it appears on the base layer, not as an overlay. I also don't think I set the bounds correctly.. any advice on setup on either end would help.
I've noted that the TMS layers as overlays is on the table as a future feature. Thanks for discussing this.
Comment #6
KrisBulman CreditAttribution: KrisBulman commentedI'm actually not even sure now if Tilecache will work for this implementation. I will look for their mailing list and research if any of the other suggested methods will work.
Comment #7
tmcw CreditAttribution: tmcw commentedHey Kris, it looks like meachams isn't a layer on that TileCache server, only basic and NASA_JPL_WMS (here's a url where it lists those).
Comment #8
KrisBulman CreditAttribution: KrisBulman commentedThanks, I'll play around with tilecache to see if I can get it to appear as a layer.
Problem being, I am not sure any of the supported examples will allow for a tiled overlay (like in my openlayers.html link) that's not just a whole map.. looks like just an imageoverlay that doesn't tile. I've posted a query to the mailing list.
Comment #9
KrisBulman CreditAttribution: KrisBulman commentedI'm also looking for other TMS options that will support this.
My original example was created with maptiler, and on their page http://www.maptiler.org/ it states:
"GDAL2tiles follows the OSGeo Tile Map Service (TMS) specification for publishing rendered maps as map tiles.
The TMS specification is implemented by several map clients (OpenLayers, WorldKit) and it is also supported by the TileCache project.
You can provide maps as pre-generated tiles using GDAL2tiles or use alternative ways of publishing with a combination of UNM MapServer (WMS), TileCache, or even GeoServer and GeoWebCache"
So I'm guessing I will have to get one of these working as a TMS implementation before we can go further here. Thanks for the help so far. If anyone else reading this has a working implementation that can be tested or can provide information on, please post it here.
Comment #10
tmcw CreditAttribution: tmcw commentedKris: yeah, it's kind of bizarre; MapTiler clearly doesn't follow the WMS spec for its examples, and I can't find a single example of it actually following the spec. It uses the OpenLayers TMS layer type, but hacks it apart in a way that nothing will support the output layers natively.
Comment #11
KrisBulman CreditAttribution: KrisBulman commentedNot that this helps much, but mapstraction looks like it does GDAL2tiles
http://www.mapstraction.com/demo-tiles.php
Comment #12
KrisBulman CreditAttribution: KrisBulman commentedPlease weigh in on the following todo's for maptiler
Mark Gray's TMS comment:
http://maptiler.uservoice.com/forums/10188-maptiler-todo/suggestions/125...
TMS tiles produced by MapTiler accessible trough WMS
http://maptiler.uservoice.com/forums/10188-maptiler-todo/suggestions/125...
Generate tiles from a WMS server supporting at least WGS84 (EPSG:4326)
http://maptiler.uservoice.com/forums/10188-maptiler-todo/suggestions/125...
Comment #13
tmcw CreditAttribution: tmcw commentedOkay, I'm 90% of the way to implementing a MapTiler layer type, and since I'm guessing there are a bunch of MapTiler layers out there, it would be a worthwhile addition to OpenLayers core. This obviously goes a bit against the idea of only supporting built-in OpenLayers layers, but I think that it's a decent addition...
Comment #14
KrisBulman CreditAttribution: KrisBulman commenteduhm.. amazing!!
Comment #15
zzolo CreditAttribution: zzolo commentedAs far as putting it into core, as long as you think it can be supported in the long run and not hold development back (like the development of a third party codebase), then I'd say go for it.
Comment #16
zzolo CreditAttribution: zzolo commentedTo clarify, I don't think either of these things apply, just stating what seems to be the policy we have had so far.
Comment #17
tmcw CreditAttribution: tmcw commentedYeah - I agree. It's about 20 lines of simple javascript, so I don't think it'll be much of a maintenance task.
Comment #18
KrisBulman CreditAttribution: KrisBulman commentedwill the changes be in dev?
Comment #19
tmcw CreditAttribution: tmcw commentedYeah - I think it'll be best to just push the changes in as soon as they're ready. It'll be a little bit - implementing another layer type got me thinking about the more-vital improvements + fixes to the system.
Comment #20
KrisBulman CreditAttribution: KrisBulman commentedCool, thanks for the update we'll keep tabs on it. In the meantime, I've installed a mapwarper instance and am about to test metacarta labs' map rectifier for ways to have our users warp images pre-maptiler.
Both produce WMS links, such as:
metacarta map rectifier WMS link: http://labs.metacarta.com/rectifier/wms.cgi?id=4009
mapwarper WMS link: http://warper.geothings.net/maps/wms/2469
but the plan is to obtain the the warped images and push them through maptiler for display through your module. :)
Comment #21
tmcw CreditAttribution: tmcw commentedOkay - MapTiler layer type committed to the 2.x branch: http://drupal.org/cvs?commit=360038
Comment #22
KrisBulman CreditAttribution: KrisBulman commentedI tried this out, works great!
Is it possible to show the overlay the layer by default instead of having to click the checkbox?
Comment #23
tmcw CreditAttribution: tmcw commentedIt should be shown by default if you click 'Enabled' in the presets interface?
Comment #24
KrisBulman CreditAttribution: KrisBulman commentedI double checked that option (screenshot attached)
http://theming.bulman.ca/worldmap
I also noticed it was appearing as a baselayer and not an overlay in the settings window, even though the baselayer option is not checked in the actual layer settings. It does, however, display as an overlay on the map regardless of this.
Comment #25
tmcw CreditAttribution: tmcw commentedI think this is caused by the half-implemented system of inLayerSwitcher/enabled that resulted from another ticket...
Comment #26
KrisBulman CreditAttribution: KrisBulman commentedthis one? http://drupal.org/node/710514
Would the fact that the maptiler overlay is displaying as a baselayer instead of an overlay in the preset settings be affecting it at all? (see screenshot in previous ticket)
Comment #27
KrisBulman CreditAttribution: KrisBulman commentedShould I open a new ticket on the maptiler overlay displaying as a baselayer instead of an overlay in the preset settings?
Comment #28
KrisBulman CreditAttribution: KrisBulman commentedFrom Klokan: (the creator of maptiler)
"I recommend to add into the Drupal OpenLayers code those two lines of
JavaScript code:
// Do not display any warning for missing tiles
OpenLayers.Util.onImageLoadError =
function(){this.src='http://www.openlayers.org/api/img/blank.gif';}
OpenLayers.Tile.Image.useBlankTile=false;
Better then http://www.openlayers.org/api/img/blank.gif would be to
use img/blank.gif on the local copy of OpenLayers. This will avoid
displaying of any artifacts for missing tiles in MapTiler layer."
Comment #29
tmcw CreditAttribution: tmcw commentedI've created a ticket here to handle that issue: http://drupal.org/node/787838
Comment #31
klokantech CreditAttribution: klokantech commentedThere is now a step by step tutorial for how to use MapTiler with Drupal made by Paul Vreede.
See attachment of the ticket:
https://www.drupal.org/node/2384877