javascript - Scaling multiple paths with raphael -


I'm trying to use Rafael to create a map tool similar to this in the webpage.

I have a SVG file of the map that I want to use, and there are all different paths in the provincial file. However, if I copy coordinate to make a RAFEL path straight as SVG file, the image is too large to suit the screen and so I need to scale it.

I know that I can personally scale scale of all the province paths, but then they will now touch each other, and I surround them with re-collecting the map Have to move.

Is there a way to group the path together and group the whole thing, or is there a smart tool to scale the original SVG file? .. Inkscape scaling does not seem to modify coordinates in SVG file

thanks

source:

  window.onload = function () Paper = new rafael (document.getElementById ('canvas_container'), 20004000); Var province = {} province.a = paper. ("M1195.23,2765.05 1176.44,2753.8 1182.93,2743.86 1198.21,2745.13 1201.92,2738.12 1263.62,2752.62 1284.76,2743.95 1317.8,2750.74 1367.35,2746.42 1392.66,2715.11 1400.21, 2696.4 1414.4,2707.23 1451.71,2707 1456.93,2690.06 1486.98, 2691.43 L5l7k68,2685k62 L560k8l,264lk94 L566k44,2625k9l L655k76,2577k95 L652k86,2580k9l L640k92,26l4k69 L6l0k92,2642k3l L590k74,2684k67 L565k32,2702k68 L559k58,2720k44 L52lk84,2784k07 1477.67, 2814.72 L46lk87,282lkl5 L442k92853k64 L440k0,2874k94 L420k09,2879k49 1381.85 , 2932.98 1336.52,29 9 6.11 1318.762929.64 1294.492938.23 1287.22923.45 1265.552923.98 1246.43,2913.8 1239.94,2901.71213.382884.24 1206.33,2881.17 1214.32,2876.4 1199.89,2858.79 1204.99,2841.58 1220.87,2835.67 1210.72 , 2812.63 1232.15,2807.48 1225.15,2793.26 1231.23,2781.47 1213.41,2762.4 1195.23,2765.05 Zed "); Province.b = papers ("M1050.73,2867.78 1046.35,2845.33 1040.23,2832.74 1066.03,2819.42 1087.07,2805.18 1094.97,2784.45 1104.23,277 9.31 1115.05,2774.95 1131.12,2800.44 1146.19,2792.66 1146.45,2777.11166.57,2777.52 1166.63, 2804.27 1194.54,2818.11 1210.742812.67 1220.87 , 2835.67 1204.99,2841.58 11 99.89,2858.791214.32,2881.17 1213.98,2881.24 1239.54,2901.7 1246.43,2913.8 1265.552929.98 1287.22923.45 1294.492938.23 1310.722940.64 1318.562959.93 1336.52299.111 1320.712984.32 1320.222984.45 130 9.88 , 3001.29 1297.83,29 9 3,41293.02,2997.09 1289.27,3013.92 1283.96,3022.6 1275.93,3022.85 1266.23024.26 1259.83,3020.74 1253.98,3024.67 1246.93,3031.3 1237.88,3017.88 1214.41,3015.12 1185.95,3005.82 1174.43,3017.4 1174.77, 3035.97 1170.62, 3043.42 1158.95,304.47 1137.743036.82 1127.733030.16 1114.84,3035.16 1101.49,3035.03 1102.89,3011.96 1123.59299 2.6 1137.04299 9431130.852973.55 1120.312972.88 1114.08,2984.93 1100.47, 2983.63 1095.19,2970.61 1085.652970.31 1077.68, 2950.18 1061.43,2942.38 1057.592940.54 1055.362929.83 1041.79,2915.84 1041.19,2898.89 1048.93,2884.2 1032.892877.32 1038.29,2867.02 1050.73,2867.78 J "); Province a. Scale (.5, .5); Province Bscil (.5, .5); }        

Code> scale (x, y, cx, cy);

Where there are coordinates of cx and cy scaling center. By default it is in the middle of the shape, so to scale two sizes, you need the relative scale of the same center.


Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -