Simple question

James Sohr jms4 at PO.CWRU.EDU
Thu Apr 21 11:07:30 EDT 2005


Sure... since the image URL needs to be generated on the client side
anyways.

The best way of doing this is through Javascript.

I've thrown a small sample of this in action at
http://www.houseclick.com/map.htm

It uses a small piece of JavaScript which keepts track of the map URL,
as well as the current map size, current extent, and even can toggle a map
layer on and off.  All options are stored in JavaScript variables,
and wheenever an option is changed, the new URL is reconstructed using the
variables and the image is updated.

The map URL is actually just the path to the MapServer CGI, plus with
some MapServer options passed using CGI variables.

The key CGI variable to use here is the "mode" variable-- set it to "map"
to have the MapServer CGI spit out just a map image.


For instance, the URL

http://www.houseclick.com/cgi-bin/mapserv?mode=map&mapext=-
9561082+4629954+-
8761082+5429954&map=/var/www/map/map.map&mapsize=400+400&layer=roadtrl020&l
ayer=states

spits out just a map image :

  with an extent of -9561082,4629954 to -8761082, 5429954

  using the map file located at /var/www/map/map.map

  with a size of 400 width by 400 height

  with layers "roadtrl020" and "states" turned on .


It's really quite simple.

Hope that helps...

 -James




On Thu, 21 Apr 2005 16:12:20 +0200, Sylvain Beorchia <sbeorchia at GI-
LEMANS.COM> wrote:

>That's right, but by doing this way, can you retreive an image url on the
>client side ?
>I mean, in my application i need to reference the generated image map from
>two different places....so i need an url...
>
>thanks .
>Sylvain.
>
>----- Original Message -----
>From: "James Sohr" <jms4 at PO.CWRU.EDU>
>To: <MAPSERVER-USERS at LISTS.UMN.EDU>
>Sent: Thursday, April 21, 2005 3:51 PM
>Subject: Re: [UMN_MAPSERVER-USERS] Simple question
>
>
>> This is my personal opinion, but I think the best way to get rid of the
>> temporary images is to never create them in the first place.
>>
>> You can configure the mapserver CGI executable to output just a map
image
>> straight to the web browser (intead of it generating a temp image and
>> outputting an HTML file).  You can then use a plain HTML (or PHP or
>> whatever other language you'd like) page that wraps around the image and
>> is responsible only for passing paramaters to the MapServer CGI and
>> updating the map image.
>>
>> Thus, you create no temp images, and there is no need to reload the
whole
>> page to update the map-- you only need to reload the map image.
>>
>> This is how most of the major map websites do it...
>>
>>
>>
>>
>> On Thu, 21 Apr 2005 15:26:58 +0200, luca marletta <lucamarle at GMAIL.COM>
>> wrote:
>>
>>>Till now I've no experience with a real mapserver live application on
>>>a 24/7 server and, maybe I lost some passage, but I'm wondering if
>>>there is a simple and easy way to get rid of all images that fill the
>>>images directory.
>>>
>>>Sorry if is a very silly question but I miss this point
>>>
>>>Thanks in advance or your help
>>>
>>>luca
>>>--
>>>luca marletta  icq: 70590647



More information about the mapserver-users mailing list