zyucar / imgmap

Automatically exported from code.google.com/p/imgmap
GNU General Public License v2.0
0 stars 0 forks source link

Not able to use the API in example1.html #38

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Open the API (is inside the download zip file, not online?)
2. Try to use setMapHTML in the example1.html

What is the expected output?
 "Get or set map html code easily"

What do you see instead?
 Method not found error 

Original issue reported on code.google.com by w.bre...@gmail.com on 5 Sep 2010 at 4:34

GoogleCodeExporter commented 9 years ago
I've already found the solution.

In the example js-files the object where you can do all API functions on is 
created, and is called myimgmap.

E.g. If you want to set the map HTML you can add

<a href="javascript:setMapHTML();">Set map</a>
<script>
function setMapHTML(){
 myimgmap.setMapHTML('<map id="imgmap201095184256" name="imgmap201095184256"><area shape="rect" alt="" title="" coords="352,206,499,308" href="" target="" /><!-- Created by Online Image Map Editor (http://www.maschek.hu/imagemap/index) --></map>');
}
</script>

make sure that the code is loaded after the page completes loading the 
following files:

<script type="text/javascript" src="../imgmap.js"></script>
<script type="text/javascript" 
src="example1_files/default_interface.js"></script>

Original comment by w.bre...@gmail.com on 5 Sep 2010 at 4:47