W3C home > Mailing lists > Public > www-svg@w3.org > July 2012

SVG Element Drag/Drop Issue on Zoomed in SVG

From: <vishal@aegisisc.com>
Date: Wed, 25 Jul 2012 16:59:20 +0530
To: <www-svg@w3.org>
Message-ID: <1aae8094$310c6f50$238f935a$@com>

Dear Friends, 

i'm stuck with the below mentioned scenario, 

Following Implementations are done,

1) i'm loading svg in html division as shown below,

	$('#SvgDIV').svg({ loadURL: 'map.svg', onLoad: function () {

		// here i'm binding some functionalities with jquery



here map.svg is representing a map

2) [Drag and Drop From HTML DIV To SVG] 

I have another html division i.e. <div id="pqr" class="drag"> <ul><li 
class="abc" image="xyz.svg">XYZ</li></ul> </div>

here xyz.svg represents an element,And i'm placing/appending this element 
as an svg image tag on above map (i.e. mentioned in point-1),

To accomplish that I'm dragging this <li> to above loaded svg map in 
"SvgDIV" division with the help of jQuery UI plugin.

As a result,xyz.svg(element) that is binded with <li class="abc"> will be 
appended as an svg image tag in map.svg (map) on the drop event of <li>

3) [Drag and Drop From SVG To SVG] 

Drag & Drop of svg element(xyz.svg) in map.svg(map) with the help of jQuery 
UI plugin only.

4) SVG Zoom in out functionality without panning by playing with Viewbox 

coordinates of root element of map SVG i.e. map.svg, 

Implemented Point 3 & 4 are Drag and Drop without zooming in/out the 
map,that means map is in its original size and position 

when we are making Drag/Drop From SVG To SVG and From HTML DIV to SVG,

the issue is with drag and drop of an element along with zoom in/out of the 

Issue 1 : Is it possible/feasible If I want to drag & drop element(xyz.svg) 
on map(map.svg) at the time of ZOOM IN IS APPLIED ON THE MAP? 

and if it is correct approach/possible then how to get correct 
position/actual coordinates of element 

in map on drop event of that svg element? (Please suggest any possible way 
to achieve this) 

Issue 2 : When i try to drag element from map and drop it to the map only 
that time also getting problem to get actual position/coordinates of 
element on map

Please suggest the possible ways to get rid of it. 


Received on Wednesday, 25 July 2012 11:30:47 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:54:36 UTC