Html Svg Map

0
0

I have a html svg map , when I  click a city of map , I want to get id clicked of city  (<g id>)

I attacted a small sample , please help me this topic

 

Thanks

Attachment
  • You must to post comments
0
0

Hi,

The best way to do this is to create a click handler for the iFrame element that calls a WebMethod (and passes an id parameter) in your code.  You can add this in the ClientEvents property of the iFramePanel.

I attached your sample with the implemented feature.  Please let me know if it works for you.

Best regards,

Levie

Attachment
  • You must to post comments
0
0

Thanks Levie

Your sample is work but ,  when I iframe put on any panel , it dosen’t work.

 

I attached a  sample

 

Thank you very much for help

Attachment
  • Levie (ITG)
    Hi, you will need to watch the JavaScript to see what it’s referring to (check the browser console). Change “var form = this.getParent();” to: “var form = App.Window1;” in your ClientEvents script. Make sure you have the hierarchy correct for accessing the Window’s methods (make sure the JavaScript is referring to the correct parent). Let me know if this works. Best regards, Levie.
  • HSoft
    • HSoft
    • May 16, 2019 - 12:37 pm
    var form = App.MyDesktop; this.getWindow().addEventListener(‘click’, function(e){ var target = e.target; var id = e.target.id; while(id == “”) { target = target.parentElement; id = target.id; } form.handleIFrameClick(id); });
  • HSoft
    • HSoft
    • May 16, 2019 - 12:37 pm
    I changed var form = App.MyDesktop; but this frame not work on dektop page
  • HSoft
    • HSoft
    • May 20, 2019 - 12:42 pm
    Hi Levie I dont work on dektop page , Can you help me this topic ?
  • You must to post comments
0
0

Crome console error attacted ,

I think  var form = App.MyDesktop; line wrong on desktop page.

 

Thanks for helps

 

Attachment
  • You must to post comments
0
0

Hi,

it should read

var form = App.Desktop;

(not MyDesktop).

And you need to declare the WebMethod in Desktop.cs like you did in Window.cs

Then your sample works fine for me.

Best regards
Frank

  • Levie (ITG)
    Did this solution work for you, HSoft? Best, Levie
  • You must to post comments
Showing 4 results
Your Answer

Please first to submit.