[OpenLayers-Dev] Fix for issue #327: ka-Map overlays

Pedro Simonetti pedrosimonetti at gmail.com
Thu Apr 10 18:23:37 EDT 2008


Hi all,

I'm doing an upgrade in the Veracidade project that was initially made over
ka-Map.
http://www.veracidade.com.br/

Were upgrading the whole project. We're upgrading our imagery database and
including new featues, so I felt 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/327

The 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.
-- 
View this message in context: http://www.nabble.com/Fix-for-issue--327%3A-ka-Map-overlays-tp16620073p16620073.html
Sent from the OpenLayers Dev mailing list archive at Nabble.com.




More information about the Dev mailing list