[OpenLayers-Users] Failing with Ka-Map...

Jeff Dege jdege at korterra.com
Thu Aug 10 10:47:07 CDT 2006


I have, after some playing around, an installation of ka-map v0.2
working against the gmap demo map data.  I'm now trying to get the map
to display using OpenLayers' kamap layer type.


The only change I've made to the gmap configuration is to add a "GROUP
'all'" entry to each layer:

  # FILE: gmap75.map
  #
  # Start of GMAP map file
  #
  #
  NAME GMAP_DEMO
  STATUS ON
  SIZE 400 300
  SYMBOLSET ../etc/symbols.sym
  EXTENT -2200000 -712631 3072800 3840000
  UNITS METERS
  SHAPEPATH "../data"
  IMAGECOLOR 255 255 255
  FONTSET ../etc/fonts.txt

  [...]

  LAYER
    NAME bathymetry
    GROUP 'all'
    METADATA
      "DESCRIPTION" "Elevation/Bathymetry"
    END
    TYPE RASTER
    STATUS ON
    DATA bath_mapserver.tif
  END

  LAYER
    NAME land_fn
    GROUP 'all'

  [...]

The gmap installation works, when accessed directly:

   http://www.visi.com/~jdege/gmap-test.gif


With ka-map, I've edited include/config.php, to us the correct dlls, and
to point to the gmap installation:

  <?php
 
/**********************************************************************
   *
   * $Id: config.dist.php,v 1.4 2006/02/07 03:20:18 pspencer Exp $

  [...]

  $szPHPMapScriptModule = 'php_mapscript_48.'.PHP_SHLIB_SUFFIX;
  $szPHPGDModule = 'php_gd2.'.PHP_SHLIB_SUFFIX;

  [...]

  $aszMapFiles = array(
    "gmap" => array( "GMap", "/ms4w/apps/gmap/htdocs/gmap75.map",
                       array(30000000, 10000000, 3000000, 1000000),
                       "PNG")

  /* Add more elements to this array to offer multiple mapfiles */

  );

  [...]

  $szMap = 'gmap';

  [...]

And it works fine:

   http://www.visi.com/~jdege/kamap-test.gif

But when I try to access the layer through OpenLayers, I get some
serious tiling artifacts.

This is what I'm doing:

  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  
  <html xmlns="http://www.w3.org/1999/xhtml" >
  
  <head>
      <title>OpenLayers/Ka-Map Test</title>
  	<script type="text/javascript"
src="./release-1.0/lib/OpenLayers.js"></script>
  </head>
  
  <body>
  
  	<h3>OpenLayers/Ka-Map Test</h3>
      
  	<div style="width:100%;height:800px" id="mapDiv" />
  
  	<form id="form1" runat="server">
  	</form>
  
  
    <script type="text/javascript" defer="defer">
  
      var map = new OpenLayers.Map('mapDiv', 
  		{ 
  			controls:[]
  		}
  	);
  
  	var baseLayer = new OpenLayers.Layer.KaMap("Cities",
                  "http://localhost:8080/kamap/tile.php?",
  				{ map: 'gmap', g: 'all' },
  				'meters', 
  				72 );
  
      map.addLayer(baseLayer);
  
  	map.addControl(new OpenLayers.Control.PanZoomBar());
  	map.addControl(new OpenLayers.Control.LayerSwitcher());
  	map.addControl(new OpenLayers.Control.MouseToolbar());
  
  	map.zoomToFullExtent();
  
    </script>
  
  </body>
  </html>

And this is what I get:

   http://www.visi.com/~jdege/openlayers-test.gif

What am I missing?




More information about the Users mailing list