Hi all,
I'm doing an upgrade in the Veracidade project that was initially made over ka-Map.
http://www.veracidade.com.br/We're upgrading the whole project. We're upgrading our imagery database and including new featues, so I felt it was a good step to migrate to OpenLayers, giving the benefits OL offers to customization and user interaction.
As every project, we have a limited schedule, but I hope this jorney will bring some goodies to the OL community, specially for those using OL+ka-Map.
I've made some changes in the OL's ka-Map interface, and I would like to share this with you all. I'll break those changes in different threads to make it easier to future research.
So here we go. There is a problem in the "tile.php" file (named "examples/kamap.txt") related to ka-Map overlays.
http://trac.openlayers.org/ticket/327The solution is actually very simple. The code was missing to uppercase the output format, so if you set your map in .js with "i" equals to "gif", the code won't cacth this, and will use de default value from "tile.php" configuration section.
I've break this file in two files "tile.php" and "config.php" to allow a single configuration file be shared with both "tile.php" and "precache.php" (I'll discuss prepache changes in another thread).
I'll posting a patch on the tracker for this issue.
Here goes a suggestion. Since there will be 3 different php files related to ka-Map, I think will be good, to create another directory for those files, maybe in "examples/kaMap", for example. I think also that is good to put those files named "tile.php.txt", "config.php.txt", and "precache.php.txt", to a better readibility.
This changes required a little change in KaMap.js, because the constant "OpenLayers.Layer.KaMap.DEFAULT_PARAMS" souldn't be used, as the default output format is taken from "config.php" file.
So, I'll post in the tracker a separated patch for this.
Here a simple example of creating two ka-Map layers:
// The output format used will be that informed at "config.php",
// since the parameter "i" was not used.
var kamap_base = new OpenLayers.Layer.KaMap(
"Satellite",
"
http://www.openlayers.org/world/tile.php",
{g: "satellite", map: "world"}
);
// Create an ka-Map overlay layer (using "isBaseLayer: false"). Forces
// the output to be a "gif", using the "i" parameter.
var kamap_overlay = new OpenLayers.Layer.KaMap(
"Streets",
"
http://www.openlayers.org/world/tile.php",
{g: "streets", map: "world", i: "gif"},
{isBaseLayer: false}
);
regards,
Pedro Simonetti.
After some discussion with Paul [1] about the directory structure isse, I've made some changes as he suggested. So, the patch that sould be used is this second version I'm publishing in the issue tracker [2].
[1] http://www.nabble.com/Patch-for-a-ka-Map-cached-layer-tp16623387p16623662.html