[Mapbender-users] Usemap
Pieter Deckers
pieter.deckers at vliz.be
Tue Dec 12 08:08:25 EST 2006
Hi Marc,
I made the error myself. Now everything is working with the original code. I replaced the url in /php/mod_usemap.php and in /javascript/mod_usemap.php but I shouldn't have done that. Now I know that I only had to change this line (from /javascripts/mod_usemap.php):
var mod_usemap_wfs = "<url>";
and nothing in /php/mod_usemap.php.
Maybe that's something that can be clarified in the documentation:
'If you want to use the usemap element: fill in the url of your GML in /javascripts/mod_usemap.php on this line:
var mod_usemap_wfs = "<url>";
like this:
var mod_usemap_wfs = "http://localhost/cgi-bin/mapserv.exe?map=C:/data/unesco/mapfiles/unesco_wfs.map&REQUEST=getFeature&VERSION=1.0.0&SERVICE=WFS&typename=Buoys";
'
I have one more question: now I want to open a new window by clicking on the points. In the javascripts is a function 'over' that is for the coloring of the points when you go over the points. I tried to make a similar function 'click' but that doesn't work. Is there any way to catch that event (clicking).
Cheers,
Pieter
>Hi Pieter,
>
>/javascripts/mod_usemap.php & /php/mod_usemap.php
>
>Pieter Deckers schrieb:
>> Thanks Till,
>>
>> the hint for unhiding the iframe was very usefull. Unless it didn't display the link I could solve the problem.
>>
>> But I had to change therefore the source code. I changed line 29:
>> $url = urldecode($_REQUEST["url"]);
>> in
>> $url = "url"
>> and then it was working fine.
>>
>To me it is at least very surprising. In /javascripts/mod_usemap.php the
>url is escaped using JavaScript, meaning all specialchars and
>control-characters are converted to hexadecimal number values with a
>leading %-character. In the file /php/mod_usemap.php this process is
>reverted using the php-function urldecode. This should work... or am I
>missing something? Maybe the url should be encoded using |the
>encodeURIComponent()-function instead of the escape()-function within
>the JavaScript-file. I'll send a copy of this mail| to the dev-list as
>well, as this might be a problem that should be discussed there, too.
>
>Pieter, could you please post the generated HTML source (!) code of
>this example using your values?
>
>$before_decoding = $_REQUEST["url"];
>$after_decoding = urldecode($_REQUEST["url"]);
>
>echo "Not decoded: " $before_encoding . "<br />\n decoded: " . $after_encoding;
>
>It would be interesting to me what broke the script in your case...
>
>Thanks in advance
>
>
>> I don't know if this is an error in the code or a wrong setting of me.
>>
>>
>I don't know, either. Lets have the dev-list look at this...
>> Cheers,
>>
>> Pieter
>>
>>
>-- Marc
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe at mapbender.osgeo.org
>For additional commands, e-mail: users-help at mapbender.osgeo.org
More information about the Mapbender_users
mailing list