Reference Map

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Reference Map

Eduardo Zenaide
hi all,

something is wrong with my reference map. i'm using
<input type="image" src="[ref]" />
and it generate ok, but its not working.
just don't act like on GMap, where i can use it as pan.

on map file:

REFERENCE
    IMAGE media/images/parara.png
    EXTENT -38.234122 -11.52665 -34.594394 -8.133178
    STATUS ON
    COLOR -1 -1 -1
    OUTLINECOLOR 255 0 0
    SIZE 120 90
END

i've seen some examples using name parameter on html input
<input type="image" src="[ref]" name="KEYMAP" />
but i tried and nothing happens, also i didn't found KEYMAP anywhere, so i think its nothing :P


thanks!

--
Eduardo Zenaide
Reply | Threaded
Open this post in threaded view
|

Re: Reference Map

Eduardo Zenaide
thanks, Ian, but nothing changed :(

2007/1/9, Ian Tidy <[hidden email]>:
I think the IMAGE has to be a GIF file and not PNG.
 
Cheers Ian
From: UMN MapServer Users List [mailto:[hidden email]] On Behalf Of Eduardo Zenaide
Sent: Wednesday, 10 January 2007 8:24 a.m.
To: [hidden email]
Subject: [UMN_MAPSERVER-USERS] Reference Map

hi all,

something is wrong with my reference map. i'm using
<input type="image" src="[ref]" />
and it generate ok, but its not working.
just don't act like on GMap, where i can use it as pan.

on map file:

REFERENCE
    IMAGE media/images/parara.png
    EXTENT -38.234122 -11.52665 -34.594394 -8.133178
    STATUS ON
    COLOR -1 -1 -1
    OUTLINECOLOR 255 0 0
    SIZE 120 90
END

i've seen some examples using name parameter on html input
<input type="image" src="[ref]" name="KEYMAP" />
but i tried and nothing happens, also i didn't found KEYMAP anywhere, so i think its nothing :P


thanks!

--
Eduardo Zenaide
This e-mail message has been scanned and cleared by MailMarshal
<a href="http://www.marshalsoftware.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">www.marshalsoftware.com




--
Eduardo Zenaide
Reply | Threaded
Open this post in threaded view
|

Re: Reference Map

Eduardo Zenaide
In reply to this post by Eduardo Zenaide
Ian,

i've put your code on a php file wich i included on my template and add name=KEYMAP on my input. like:
<input type="image" src="[ref]" name="KEYMAP" />

didn't work. what i'm missing?

2007/1/9, Ian Tidy <[hidden email]>:
Sorry,  I didn't read your message properly.
 
To get the keymap to pan, you need some code in your web page.
 
My KEYMAP name is KEYMAP and the code to pan is something like this (PHP code):
 
// Key Map
    if ($_POST["KEYMAP_x"]) {
 
     $dfKeyMapXMin = $map->reference->extent->minx;
     $dfKeyMapYMin = $map->reference->extent->miny;
     $dfKeyMapXMax = $map->reference->extent->maxx;
     $dfKeyMapYMax = $map->reference->extent->maxy;
 
     // Click Position
     $nClickPixX = ($_POST[KEYMAP_x]);
        $nClickPixY = ($_POST[KEYMAP_y]);
 
        $dfWidthPix = doubleval($_POST[KEYMAPXSIZE]);
        $dfHeightPix = doubleval($_POST[KEYMAPYSIZE]);
 
  // Convert to a Geographic Co-Ordinate
  $geoWidth = ($dfKeyMapXMax - $dfKeyMapXMin) / $dfWidthPix;
  $geoHeight = ($dfKeyMapYMax - $dfKeyMapYMin) / $dfHeightPix;
  $keymap_x = ($nClickPixX * $geoWidth) + $dfKeyMapXMin;
  $keymap_y = $dfKeyMapYMax - ($nClickPixY * $geoHeight);
 
  // Set Map Extents
  $mapext_x = ($map->extent->maxx - $map->extent->minx) / 2;
  $mapext_y = ($map->extent->maxy - $map->extent->miny) / 2;
  //$my_extent = ms_newrectObj();
  //$my_extent->setextent($keymap_x - $mapext_x,$keymap_y - $mapext_y, $keymap_x + $mapext_x,$keymap_y + $mapext_y);
  $map->setExtent($keymap_x - $mapext_x,$keymap_y - $mapext_y, $keymap_x + $mapext_x,$keymap_y + $mapext_y);
  $keymap_text = "<!-- KEYMAP CLICK=".$nClickPixX.", ".$nClickPixY." GEO=".$keymap_x.", ".$keymap_y." -->";
    }
There is a small bug in this code that I am still working on.
 
Hope this helps.
 
Cheers Ian




--
Eduardo Zenaide