[mapserver-users] Re: choosing region of interest using "referencemap"
Ludwig Kniprath
ludwig at kni-online.de
Sun Mar 28 04:49:14 PDT 2010
We implemented such a feature with Javascript and PHP-Mapscript.
Serverside (Mapscript):
- Get extent (reference_map->extent) and
- size of reference-map-image (reference_map->width,
reference_map->height, pixel),
- Calculate the cellsize (meter per pixel),
- return these values to the client-browser (with Ajax f. e.).
(Hint: if you know these values and they don't change, you can also
hard-code them in javascript)
Clientside Javascript:
- register mouse-down and mouse-up-events for the reference-map,
- get mouse-down and mouse-up cursor-positions of these events relativ
to the upper-left corner of the reference-map (pixel),
- calculate the real-world-coordiantes of the events with
cursor-position, cellsize and the real-world-coordiantes of the
upper-left reference-map-corner => new extent,
- call the new map-image (and the new reference-map-image) for this extent.
Ludwig
> Message: 1
> Date: Sat, 27 Mar 2010 13:15:23 +0200
> From: ahmet temiz <ahmettemiz88 at gmail.com>
> Subject: Re: [mapserver-users] choosing region of interest using
> "referencemap"
> To: mapserver-users at lists.osgeo.org
> Message-ID:
> <37ee0091003270415y77dd5281p7b08b875cc5a88e5 at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> Let me put it another way:
>
> I just want to set map extent from reference map using rectangle clip
>
> regards
>
> 2010/3/26 ahmet temiz <ahmettemiz88 at gmail.com>:
>
>> Let me put it another way:
>>
>> I just want to set map extent from reference map using rectangle clip
>>
>> regards
>>
>> 2010/3/26 Cristiano Sumariva <sumariva at gmail.com>:
>>
>>> What do you mean by region of interest?
>>> Want a highlight when a click happen over image ?
>>>
>>> 2010/3/26 ahmet temiz <ahmettemiz88 at gmail.com>
>>>
>>>> hello
>>>>
>>>> I was wondering how I could choose region of interest using "referencemap"
>>>> ?
>>>>
>>>> Could you give me a hint ?
>>>>
>>>> regards
>>>> _______________________________________________
>>>> mapserver-users mailing list
>>>> mapserver-users at lists.osgeo.org
>>>> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>>>>
>>>
More information about the MapServer-users
mailing list