<div dir="ltr">I got the javascript and form working for the map application using the map of my garden. You can see how it works on this test page:<div><div><a href="http://ediblelandscape.org/pmwiki.php?n=Test.MapPointedAt">http://ediblelandscape.org/pmwiki.php?n=Test.MapPointedAt</a><br>
<div><br></div><div style>I pasted the code below in local/config.php. I have a custom markup called (:canvas:) that I can put on any page.</div><div style><br></div><div style>I didn't use pmwiki forms because I don't understand how to. Maybe someone could coach me. One thing I would like to do is this:</div>
<div style><br></div><div style>I am hoping to generate a list of pages corresponding to the area clicked on the map.<br></div><div style>1. Position the cursor over a map location, then capture the x,y coordinates of the mouse click location (it is working!)</div>
<div style>2. Using markup, pass the form values form_x.value and form_y.value or the variable pos_x and pos_y to the standard Pagelist pmwiki markup. (need help)</div><div style><br></div><div style><br></div><div><div>#------javascript for canvas-------</div>
<div>$HTMLHeaderFmt[] = '<script language="JavaScript"></div><div>function point_it(event){</div><div>pos_x = event.offsetX?(event.offsetX):event.pageX-document.getElementById("myCanvas").offsetLeft;</div>
<div>pos_y = event.offsetY?(event.offsetY):event.pageY-document.getElementById("myCanvas").offsetTop;</div><div><br></div><div>document.pointform.form_x.value = pos_x;</div><div>document.pointform.form_y.value = pos_y;</div>
<div><br></div><div>var c=document.getElementById("myCanvas");</div><div>var ctx=c.getContext("2d");</div><div><br></div><div>ctx.strokeStyle="#FF0000";</div><div>ctx.clearRect(0,0,672,233);</div>
<div>ctx.fillStyle = "rgba(255,100,100,0.4)";</div><div>ctx.fillRect(document.pointform.form_x.value-10,document.pointform.form_y.value-10,20,20);</div><div>}</div><div></script>';</div><div><br></div>
<div>Markup('canvas', 'directives',</div><div>  '/\\(:canvas:\\)/e',</div><div>  'Canvas($pagename)');</div><div><br></div><div>function Canvas($pagename)</div><div>{ </div><div>$out="<form name=\"pointform\" method=\"post\">";</div>
<div>$out=$out."You pointed on x = <input type=\"text\" name=\"form_x\" size=\"4\" /> , and y = <input type=\"text\" name=\"form_y\" size=\"4\" />";</div>
<div>$out=$out."</form>";</div><div>$out=$out."<canvas id=\"myCanvas\" onclick=\"point_it(event)\" width=\"672\" height=\"233\" style=\"border:1px solid #c3c3c3; background-image:url('<a href="http://ediblelandscape.org/images/other/PaintDotNetMap05.jpg')">http://ediblelandscape.org/images/other/PaintDotNetMap05.jpg')</a>;\">";</div>
<div>$out=$out."</canvas>";</div><div>return Keep($out);</div><div>}</div><div>#---------------------------------</div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Jun 13, 2013 at 8:55 AM, Petko Yotov <span dir="ltr"><<a href="mailto:5ko@5ko.fr" target="_blank">5ko@5ko.fr</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">Mark Lee writes:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Does the $HTMLHeadFmt go into config.php or skin.tmpl?<br>
</blockquote>
<br></div>
It goes into local/config.php to enable it on the whole wiki, or into local/YourGroup.php or into local/YourGroup.YourPage.php to enable it on a single group or page. See<br>
<br>
   <a href="http://www.pmwiki.org/wiki/PmWiki/LocalCustomizations" target="_blank">http://www.pmwiki.org/wiki/<u></u>PmWiki/LocalCustomizations</a><br>
   <a href="http://www.pmwiki.org/wiki/PmWiki/GroupCustomizations" target="_blank">http://www.pmwiki.org/wiki/<u></u>PmWiki/GroupCustomizations</a><br>
<br>
What you add into this variable will be automatically placed in the skin template at the place of the directive <!--HTMLHeader--> so you don't need to modify the skin. This is good if you use a skin made by someone else, you can install a new version without having to re-edit the skin template to add your stuff.<br>

<br>
About the forms, see <a href="http://www.pmwiki.org/wiki/PmWiki/Forms" target="_blank">http://www.pmwiki.org/wiki/<u></u>PmWiki/Forms</a> .<div class="HOEnZb"><div class="h5"><br>
<br>
Petko<br>
<br>
______________________________<u></u>_________________<br>
pmwiki-users mailing list<br>
<a href="mailto:pmwiki-users@pmichaud.com" target="_blank">pmwiki-users@pmichaud.com</a><br>
<a href="http://www.pmichaud.com/mailman/listinfo/pmwiki-users" target="_blank">http://www.pmichaud.com/<u></u>mailman/listinfo/pmwiki-users</a><br>
</div></div></blockquote></div><br></div></div></div>