[OpenLayers-Users] Scales problems

Tyler Durden tylersticky at gmail.com
Wed Sep 12 09:57:19 EDT 2007


Hi,
I'm using Openlayers, Tilecache, Mapnik and I can't figure out why the
the label Scale(OpenLayers.Control.Scale()) doesn't show the correct
value.
I mean, in my osm.xml I have:
<Rule>
            <MaxScaleDenominator>600000</MaxScaleDenominator>
            <MinScaleDenominator>500000</MinScaleDenominator>
            <Filter>[dispclass] = 2 or [dispclass] = 7</Filter>
            <TextSymbolizer name="name" face_name="DejaVu Sans Book"
size="12" fill="#000000" halo_radius="1" />
</Rule>

When the Scale shows 512K doesn't show the rule above.
It should, because the Scale is 512000 and is between 500000 and 600000.

Any ideas?

My code:

JAVACRIPT
=========

MyMap = function() {
    this.bounds = new OpenLayers.Bounds(-32.691403, 23.502536,
-5.299716, 50.894223);
    this.options = { maxResolution : ((32.691403 - 5.299716) / 256) / 4,
                     numZoomLevels : 12,
                     projection    : "EPSG:4326",
                     maxExtent     : this.bounds,
                     controls      : []}
}

MyMap.prototype.init = function() {
    this.map = new OpenLayers.Map('map', this.options);
    this.name = "Continente";
    this.layer_continente = new OpenLayers.Layer.WMS("continente",
"http://192.168.1.165:8080/", {"layers":"continente",
"format":"image/png"});
    this.map.addLayer(this.layer_continente);

    (...)
}

(...)

var initMap = function() {
    map = new MyMap();
    map.init();
}

TILECACHE
=========
[cache]
type=DiskCache
base=/home/nmariz/python/projects/maps/tilecache/cache

[continente]
type=MapnikLayer
layers=streets,cp,...
mapfile=/var/www/map/osm.xml
bbox=-32.691403,23.502536,-5.299716,50.894223
maxResolution=0.026749694
extent_type=loose
levels=12
extension=png
srs=EPSG:4326
metaTile=yes
metaBuffer=100
debug=on



More information about the Users mailing list