[mapserver-users] Zoom to Object - ProblemProblem with templete variables
Michael Achtzehn
M.Achtzehn at cui.de
Mon Sep 10 00:21:00 PDT 2001
Hi Group,
here my problem still once in detail:
I would like to show a query result on certain scale, but BUFFER or SCALE parameter does nothing. Steve gave me datzu the following tip:
"Hi Michael: You're correct, this doesn't work on 3.4, but will in 3.5 (currently doesn't). It's not a technical issue rather one of priorities in getting things working. You can work around this by not using a query map but rather adding a second layer to use in displaying the query results. For this second layer you're going to modify the class expression dynamically to isolate the chosen record and draw it special. You do this within an <img...> tag that normally would be used to display the querymap. Here's how: - add a second layer to your mapfile, it should reference the same data as you want to query and define the class to draw the selected feature as you wish, the class item should be 'regnrba'. Don't define a class expression. Place this layer AFTER the main layer and set it's status to OFF.
- drop the query map from your mapfile
- add something like this to your template (assuming new layer is called foo)
<img src="/cgi-bin/mapserv.exe?map=[mapfile]&layer=foo&mapxy=[shpmidx]+[shpmidy]&buffer=xxxx&map_foo_class_expression=[REGNRBA]&mode=map[getlayers]"> "
But with the Variables '[shpmidx]+[shpmidy]' this don't work. What wrong do I make?
Here my File listings:
Init (html-) file (index06.html):
<html>
<head><title>Mapserver Demo Informationssystem Altbergbau</title></head>
<body bgcolor="#FFFFFF">
<center><h2>Informationssystem Altbergbau Demo 06.09.2001</h2></center>
<p><hr><p>
Start der Demo durch drücken des Knopfes unten
<form method=GET action='/cgi-bin/mapserv.exe'>
<!--Für Test: <form method=GET action='/cgi-bin/mapserv.exe'> -->
<input type='hidden' name='map' value='C:/Inetpub/wwwroot/ms_demo/isab06.map'>
<input type='hidden' name='layer' value='lsa_tfb'>
<input type='hidden' name='layer' value='lsatk200'>
<input type='hidden' name='zoomsize' value=2>
<center><input type='submit' value='Start'></center>
</form>
<p><hr><p>
</body></html>
<html>
----------------------------------------------------------------------------------------------------------------------------------------------------------------
Templete file:
<head>
<title>Mapserver - einfacher Test</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="GENERATOR" content="notepad">
</head>
<body>
<form method=GET action='/cgi-bin/mapserv.exe'>
<p>Das ist eine ganz einfache Mapserver Seite</p>
<p>Es soll Objekt mit Regnrba = 1005-23/01 angezeigt werden<p>
<p>Test Map</a><br>
<!-- This work: -->
<img border="1" src="/cgi-bin/mapserv.exe?map=ms_demo/isab06.map&layer=q_lsa_tfb&mapxy=4482400+5750000&buffer=10000&map_q_tfb_lsa_class_expression=1005-23/01&mode=map&layers=lsatk200+lsa_tfb>" </p><br>
<!-- Don't work -->
<img border="1" src="/cgi-bin/mapserv.exe?map=ms_demo/isab06.map&layer=q_lsa_tfb&mapxy=[shpmidx]+[shpmidy]&buffer=10000&map_q_tfb_lsa_class_expression=1005-23/01&mode=map[get_layers]" </p>
<p> </p>
<input type="hidden" name="imgxy" value="299.5 299.5">
<input type="hidden" name="imgext" value="[mapext]">
<input type="hidden" name="map" value="[map]">
<input type="hidden" name="savequery" value="true">
<input type="hidden" name="mapext" value="shapes">
<input type="hidden" name="mapxy" value="[shpmid]">
<input type="hidden" name="getlayers" value="[get_layers]">
</form>
</body>
</html>
Map File:
map
extent 4401328.5 5644860.0 4582087.0 5878911.5
imagecolor 255 255 255
name "Isab06 (Test Steve's Methode)"
shapepath "data"
size 600 600
status on
symbolset "symbols/all.sym"
#MA fontset eingefügt für Beschriftung der Lables
fontset "font.set"
units meters
# 1 web isab02.html
web
footer "isab06_footer.html"
header "isab06_header.html"
imagepath "C:/Inetpub/wwwroot/ms_demo/tmp/"
imageurl "/ms_demo/tmp/"
template "isab06.html"
log "isab06.log"
end
# Querymap für diese Version entfern
# 2 querymap hilite
# querymap
# STATUS ON
# STYLE HILITE
# COLOR 255 255 0
# size 700 500
# end
# 3 scalebar #none
scalebar
backgroundcolor 255 255 0
color 255 255 255
imagecolor 255 255 255
intervals 4
outlinecolor 0 0 0
size 200 7
status on
style 0
transparent true
units meters
# 1 label #none
label
backgroundcolor 0 0 0
color 255 255 0
size tiny
end
end
# 4 layer lsarb
layer
classitem "MERGE_RP"
data "lsarb"
# group "lsarb"
labelcache on
labelitem "MERGE_RP"
name "lsarb"
# postlabelcache true # Wenn Option aktiv erscheint Fläche immer oben
queryitem "MERGE_RP"
status on
type polygon
# 2 class {RP Dessau}
class
color 255 217 125
SYMBOL 2
expression "151"
name "RP Dessau"
outlinecolor 0 0 0
label
color 0 128 255
end # label
end
# 3 class {RP Halle}
class
color 255 251 195
expression "152"
name "RP Halle"
outlinecolor 0 0 0
label
color 0 128 255
end # label
end
# 4 class {RP Magdeburg}
class
color 183 223 134
expression "153"
name "RP Magdeburg"
outlinecolor 0 0 0
label
color 0 128 255
end # label
end
end
#
# Rasterlayer TK200
LAYER
NAME "lsatk200"
DATA "lsatk200.tif"
TYPE RASTER
STATUS ON
END
# 5 layer lsa_tfb
layer
name "lsa_tfb"
type polygon
status on
data "lsa_tfb"
header "lsa_tfb_header.html"
# 1 query #none
query
template "lsa_tfb_query.html"
end
# minscale 50000 # MA: nicht zu klein wählen - sonst keine Anzeige der Objekte
labelcache on
labelitem "REGNR_BA"
# postlabelcache true # wenn Option aktiv, kein Hiliting in der Abfrage!
# 2 class lsa_tfb_1
class
name "Tiefbauflaechen"
SYMBOL 0
color 255 102 0
outlinecolor 0 0 0
# 1 label #none
label
angle auto
antialias
backgroundcolor 250 250 150
buffer 2 #Größe des Labels (MA)
color 140 70 5
font "arial"
maxsize 12
minsize 7
position cr
size small
type truetype
end # label
end
end
# MA: jetzt kommt der Abfragelayer
# 5 layer q_lsa_tfb
layer
name "q_lsa_tfb"
type polygon
status off
data "lsa_tfb"
header "lsa_tfb_header.html"
# MA: Querymap für Abfrage entfernen
# 1 query #none
query
template "lsa_tfb_query.html"
end
labelcache on
labelitem "REGNR_BA"
# postlabelcache true # wenn Option aktiv, kein Hiliting in der Abfrage!
# 2 class lsa_tfb_1
class
name "regnr_ba"
SYMBOL 0
color 230 221 251
outlinecolor 0 0 0
label
angle auto
antialias
backgroundcolor 250 250 150
buffer 2 #Größe des Labels (MA)
color 140 70 5
font "arial"
maxsize 12
minsize 7
position cr
size small
type truetype
end # label
end #class
end
# Ende des Abfragelayers
# 6 reference graphics/reference.gif
reference
color -1 -1 -1
extent 4401328.5 5644860.0 4582087.0 5878911.5
image "graphics/reference.gif"
outlinecolor 255 0 0
size 120 120
status on
end
# 8 legend #none
legend
keysize 18 12
status on
# 1 label #none
label
color 0 0 89
size medium
type bitmap
end
end
end
Logfile:
Mon Sep 10 09:10:29 2001,434,198.168.200.39,Isab06 (Test Steve's Methode),0,4374758.379800 5644860.000000 4608657.120200 5878911.500000,-1.000000 -1.000000,lsa_tfb lsatk200 ,normal execution
Mon Sep 10 09:10:29 2001,47,198.168.200.39,Isab06 (Test Steve's Methode),0,4401328.500000 5644860.000000 4582087.000000 5878911.500000,-1.000000 -1.000000,q_lsa_tfb ,getNumeric(): Incorrect data type.
Mon Sep 10 09:10:30 2001,362,198.168.200.39,Isab06 (Test Steve's Methode),3,4472400.000000 5740000.000000 4492400.000000 5760000.000000,4482400.000000 5750000.000000,q_lsa_tfb lsatk200 lsa_tfb> ,normal execution
(Wy 3 entries?)
Greetings from Halle/Saale, Germany
Michael
Dipl.-Ing. M. Achtzehn
CUI - Consultinggesellschaft für Umwelt und Infrastruktur
Eisenbahnstraße 10
06132 Halle
____________________
www.cui.de
Tel.: 0345 7742 749
Fax.: 0345 7742 754
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20010910/cef9392a/attachment.htm>
More information about the MapServer-users
mailing list