Ticket #1102 (closed enhancement: fixed)
Make Reference Map extents available through CGI template
| Reported by: | jdoyon@… | Owned by: | sdlime |
|---|---|---|---|
| Priority: | high | Milestone: | |
| Component: | MapServer CGI | Version: | unspecified |
| Severity: | minor | Keywords: | |
| Cc: |
Description
I've been working on client-side JavaScript/DHTML mapping lately.
I now have an interface that does everything I need talking directly to the
MapServer CGI, without going through any form of application server (Zope in my
case).
I would like to make it possible to pan around the map using the reference map,
but this is impossible at this time because there is no way to get the reference
map's extent from a CGI template.
I've already modified my own maptemplate.c in 4.4.0 and this works fine ...
Here's the code (Place in processLine() somewhere):
// Allow access to the reference map extents if it is on.
if (msObj->Map->reference.status == MS_ON) {
sprintf(repstr, "%f", msObj->Map->reference.extent.minx); // Individual
reference map extent elements for spatial query building
outstr = gsub(outstr, "[refminx]", repstr);
sprintf(repstr, "%f", msObj->Map->reference.extent.maxx);
outstr = gsub(outstr, "[refmaxx]", repstr);
sprintf(repstr, "%f", msObj->Map->reference.extent.miny);
outstr = gsub(outstr, "[refminy]", repstr);
sprintf(repstr, "%f", msObj->Map->reference.extent.maxy);
outstr = gsub(outstr, "[refmaxy]", repstr);
sprintf(repstr, "%f %f %f %f", msObj->Map->reference.extent.minx,
msObj->Map->reference.extent.miny, msObj->Map->reference.extent.maxx,
msObj->Map->reference.extent.maxy);
outstr = gsub(outstr, "[refext]", repstr);
}
I'd like to submit this for inclusion in future versions of MapServer!
Thanks,
J.F.
Change History
Note: See
TracTickets for help on using
tickets.
