maschek / imgmap

Javascript based imagemap editor
https://www.maschek.hu/imagemap/
GNU General Public License v2.0
59 stars 33 forks source link

Help using setMapHTML() please... #6

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Code I am using is pasted below

What is the expected output? What do you see instead?

I see the JavaScript error: 'this.pic.parentNode' is null or not an object

What version of the product are you using? On what operating system?

imgmap2.0beta5 on Windows Server 2003 (server), Windows XP (client)

Please provide any additional information below.

I have successfully set the editor up and I am now trying to use the 
setMapHTML() function (in order to pass in a previously edited image map 
for re-editing), however am having some dificulties. Below is some code 
that I am testing with:

<script>
  var existingMap='<map id="imgmap2008123151556" 
name="imgmap2008123151556"><area shape="rectangle" alt="Page Link" 
title="" coords="183,42,318,209" href="http://news.bbc.co.uk" 
target="_blank" /></map><img src="test.jpg" usemap="#imgmap2008123151556" 
border="0"/>';
  </script>

  <button onclick="javascript:myimgmap.setMapHTML(existingMap)">Set 
Map</button>

I have tried passing in the map code directly but have no joy.

The result of the above (when clicking the button) is in the attached 
image and reads:

'this.pic.parentNode' is null or not an object

The way the page will (hopefully) work is that this will be passed in as 
the above.

ANY assistance you could offer would be gratefully received.

Thanks,

Darren 

Original issue reported on code.google.com by darrenro...@gmail.com on 23 Jan 2008 at 6:00

Attachments:

GoogleCodeExporter commented 9 years ago
Hi Darren,

I guess you are missing the pic_container from your imgmap instance setup. Can 
you
paste here your instance setup code?

Original comment by adam.mas...@gmail.com on 23 Jan 2008 at 1:45

GoogleCodeExporter commented 9 years ago
Hi Adam,

I have it working now. What I found I had to do was intantiate (load) and image 
prior. The below code now works.

Thanks

if (existingMap) {
    myimgmap.loadImage(selectedImage);myimgmap.setMapHTML(existingMap);
}

Original comment by darrenro...@gmail.com on 24 Jan 2008 at 5:56

GoogleCodeExporter commented 9 years ago

Original comment by adam.mas...@gmail.com on 24 Jan 2008 at 10:06

GoogleCodeExporter commented 9 years ago

Original comment by adam.mas...@gmail.com on 12 Mar 2008 at 11:30