question on query
Manfred Meier
m.meier at SPIEKERMANN.DE
Sat Aug 12 02:00:01 PDT 2006
Hello Albert,
sorry, I do not full understand your mail. Therefore I am not sure, what
you have on the screen and what you want to have. The code examples that
you gave: are these the template files which you use in your map file?
You wrote
"But I want to image of the parcel to load in the image map"
Do you mean you want a hilited parcel like in my example site? Or do you
want something like an image map in html (that means: a map-tag with
area definitions)?
For the hilited parcel you need a QUERYMAP object in your mapfile. For
example:
QUERYMAP
STATUS ON
STYLE HILITE
COLOR 0 255 255
END
Is your site available in internet, so me and others could have a look
at it?
If not, can you give me your html files and map file and an example
shapefile? I could put it on my webserver so we can look at it together
and I can make fast modifications.
Or at least can you give a screenshot with your whole application
including the result of a query?
Manfred
Albert Anderson schrieb:
> Hi Manfred,
>
> I got the query working using query templates. But I want to image of
> the parcel to load in the image map. How would I go that? I bet I need
> another table by the parcel fields. And have the information load into
> that table. Then have a link PIN link go to the image in the image map.
> Here is my code your the html, query templates. Could you help me.
>
> Albert
>
> header query code
> <br />
> <font size+1><b>Layer: Parcels</b></font>
>
> <table border=1>
> <tr>
> <th>shpidx</th>
> <th>Pin No.</th>
> <th>Section</th>
> <th>Township</th>
> <th>Range</th>
> </tr>
>
>
>
> parcels query code
> <tr>
> <td>[shpidx]</td>
> <td>
> <a href="http://[host]/cgi-bin/mapserv?
> mode=indexquerymap&
> qlayer=parcels&
> shapeindex=[shpidx]&
> shpext=[shpext_esc]&
> mapext=shape&
> map=[map]">
> [PIN]
> </a></td>
> <td>[SCT]</td>
> <td>[TWP]</td>
> <td>[RNG]</td>
> </tr>
>
> html code
> <SCRIPT TYPE="text/javascript" LANGUAGE="javascript">
> function SetSec(){
> var s = document.the_map.SCT.value;
> var t = document.the_map.T.value;
> var r = document.the_map.R.value;
>
> window.parent.location.href =
> "http://10.56.67.192/cgi-bin/mapserv?map=/home/mapdata/richland.map&mode=itemquery&mapext=shapes&slayer=parcels&imgxy=309
> 419&imgext=625173.309834 5085113.091715 718065.960556
> 5160035.212592&mapshape=&imgshape=&imgbox=&qstring=('[SCT]'='" + s + "'
> AND '[TWP]'='" + t + "' AND '[RNG]'='" + r +
> "')&qlayer=parcels&qitem=&shapeindex=&savequery=";
> }
> </SCRIPT>
>
> Manfred Meier <m.meier at SPIEKERMANN.DE> wrote:
>
> Hi Albert,
>
> about the query: your three input fields are named "SCT", "T" and "R".
> They sit in a form named "the_map" (if you used this name). The GO
> button is no submit button. It does not submit the form, it calls the
> javascript function "SetSec()" if you clicking it.
>
> This function gets the values of the three input fields and stores them
> in three variables "s", "t" and "r". Then it redirects the browser by
> setting ...location.href property to a new constructed url.
>
> As you can see in Lawrence's original code, this url contains the
> query-string for the mapserver like "[TWP]="+t where the value of
> "t" is
> filled in. Sorry if this is trivial: the names in [] must match the
> fieldnames in your data-source (perhaps dbf-file).
>
> Yesterday I had a problem in my example to construct this query. Dave
> Fawcett wrote on my mail the following example:
>
> http ... &qstring=([ZELNR]=1405)
>
> I had some '-characters around it like qstring=('[ZELNR]'='1405')
> and got not the correct result. So you have to experiment a bit I think.
>
> If you are unsure if your url is built correct you can do the
> following:
> (from Lawrence's code)
>
> function SetSec(){
> var s = document.the_map.SEC.value;
> var t = document.the_map.T.value;
> var r = document.the_map.R.value;
>
> //Store the new URL into a vraiable and show it before sending it
> var u =
> "/JasperMaps/cgi-bin/mapserv.exe?&program=%2FJasperMaps%2Fcgi-bin%2Fmapserv.exe&map=C%3A%5CInetPub%5Cwwwroot%5CMapdocs%5CLandCorner.map&zoomsize=2&layers=ortho+Monuments+LandCorners+Water+Shields+Highways+Roads+County+Sections+Quarter+Towns+Township&mode=itemquery&mapext=shapes&slayer=Sections&imgxy=320+240&imgext=1680507.39+547052.00+1844030.00+680312.51&mapshape=&imgshape=&imgbox=&qstring=('[SECTION_]'='"
> alert (u); // show it in a message box
> window.parent.location.href = u;
> }
>
> Manfred
>
> Albert Anderson schrieb:
>
> > Hi Manfred,
> >
> > Thanks. I got my panning working. Thanks for explaining it. I
> think I
> > understand it now that they all have to be one name. Thanks for your
> > help. I am still working on the query.
> >
> > Thanks,
> > Albert
> >
> > Manfred Meier wrote:
> >
> > Hi Albert,
> >
> > I copied your html code to my local server and use it for the
> template
> > in the mapfile.
> >
> > The result is: the Map Tools, Map Layers, Reference Map, legend
> titles
> > appear. The icons for the radio buttons do not appear but that's no
> > problem.
> >
> > The map appears (with some data of mine). If I click on one of
> the map
> > tools, and then into the map, then their is the correct effect.
> The map
> > zooms in or out or recenters.
> >
> > When I click on the corners of the map margin (for pan), then I get a
> > javascript error because "document.mapserv" is undefined.
> >
> > When I click on the GO button (which took a time to find it) I get
> > another javascript error, because "document.corner" is undefined. In
> > Lawrence's source code you see that "Corner" is the name of a form.
> > Your go-Button is in the form "the_form".
> >
> > Then I have changed "the_form" to "the_map" and i have changed
> > "mapserv"
> > in "document.mapserv" to "the_map". Then i deleted the line
> > "document.the_map.mode[0].checked=true" because this has an error
> > anywhere.
> >
> > Now the pan functions on the corner of the image are working. Not
> > perfect but they do. They pan an zoom. But I think this a not a big
> > problem to solve.
> >
> > I have changed the "document.corner" into document.the_map. So
> now the
> > Go button kind of works. It produces a fresh page.
> >
> > And I have changed the [program] placeholders to my actual url
> > because I
> > don't know where to set this value.
> >
> > Try to do the changes and test every step.
> >
> > I'm now out. Perhaps til tomorrow.
> >
> > Manfred
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > Albert Anderson schrieb:
> >
> > > Hi Manfred Meier,
> > >
> > > I dont know about the errors cause I do not for sure how to
> open the
> > > html code direct in the browser. I have javascript for panning
> > arrows
> > > around the image that I couldnt get working.
> > >
> > > For the go button to I have to set some sort of vaule to that? I
> > dont kow.
> > >
> > > Thanks,
> > > Albert
> > >
> > > Manfred Meier wrote:
> > >
> > > Hi Albert,
> > >
> > > when I load the html code into the browser then I get javascript
> > errors
> > > (status line of internet explorer) because document.the_map and
> > > document.mapserv are undefined. "document.the_map" is used in the
> > > javascript function set_Mode which is called in the onload event.
> > > Do you get these errors too?
> > >
> > > Maybe they come only here because I opened the html code direct
> > in the
> > > browser.
> > >
> > > Manfred
> > >
> > >
> > > Albert Anderson schrieb:
> > >
> > > > Hi Lawrence,
> > > >
> > > > I tried copying your code and changing out your information
> to fit
> > > > mine. Its not working to well. My button isnt doing anything.
> > > Here is
> > > > my html code. Maybe you can look at it? I dont know what I am
> > doing.
> > > > Thanks, Albert
> > > >
> > > > .....
> > >
> > >
> > >
> > >
> >
> ------------------------------------------------------------------------
> > > Yahoo! Messenger with Voice. Make PC-to-Phone Calls
> > >
> > > to the US (and 30+ countries) for 2�/min or less.
> >
> >
> >
> ------------------------------------------------------------------------
> > How low will we go? Check out Yahoo! Messenger�s low
> PC-to-Phone call
> > rates.
> >
>
>
> ------------------------------------------------------------------------
> Do you Yahoo!?
> Next-gen email? Have it all with the all-new Yahoo! Mail Beta.
> <http://us.rd.yahoo.com/evt=42241/*http://advision.webevents.yahoo.com/handraisers>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
More information about the MapServer-users
mailing list