1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
|
public class carte extends HttpServlet
{protected void doPost(HttpServletRequest req, HttpServletResponse rep) throws ServletException, IOException
{//Préparation du ContentType
rep.setContentType("image/svg+xml");
PrintWriter out = rep.getWriter();
out.println("<?xml version='1.0' encoding='ISO-8859-1' standalone='no'?>");
out.println("<!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.0//EN' 'http://www.w3.org/TR/2001/PR-SVG-20010719/DTD/svg10.dtd'>");
out.println("<svg xmlns='http://www.w3.org/2000/svg' width='530' height='622' viewBox='-3064 0 5297 6222'>");
out.println("<script><![CDATA[");
out.println("function action_click(region){ alert(region);}");
out.println("]]></script>");
out.println("<g style='fill:none;stroke:#000000;stroke-width:1'>");
out.println("<g id='cadre' style='stroke-width:1'>");
out.println("<rect x='-3064' y='0' width='5287' height='6212'/>");
out.println("</g>");
out.println("<g id='franche-comte' style='fill:#0000ff' onclick='action_click('franche-comte')'>");
out.println("<path d='M1523 2571c0,0 4,-21 4,-21 0,0 -19,-25 -19,-25 0,0 13,-58 13,-58 0,0 42,-34 42,-34 0,0 79,73 79,73 0,0 16,121 16,121 -20,6 -62,15 -62,15 0,0 -71,-71 -71,-71 0,0 -2,0 -2,0z'/>");
out.println("<path d='M1525 2569l-60 35 -63 -15 -35 55 -188 104 -98 56 -58 -171 21 -31 -9 -38 11 -29 69 0 23 -91 58 -13 0 -50 0 -2 100 -52 17 50 66 -33 23 58 42 -19 119 50 -42 34 -13 58 19 25 -4 21 2 -2z'/>");
out.println("<path d='M1525 2571c0,0 69,68 69,68 0,0 12,28 12,28 0,0 -25,35 -25,35 0,0 54,4 54,4 0,0 -145,200 -145,200 0,0 -69,23 -69,23 0,0 -19,29 -19,29 0,0 25,56 25,56 0,0 -106,94 -106,94 0,0 0,-2 0,-2 0,0 -11,-37 -11,-37 0,0 50,-65 50,-65 0,0 -33,-29 -33,-29 0,0 -60,-2 -60,-2 0,0 -13,-75 -13,-75 0,0 -85,-25 -85,-25 0,0 12,-123 12,-123 0,0 -2,-2 -2,-2 0,0 188,-104 188,-104 0,0 35,-55 35,-55 0,0 63,15 63,15 0,0 60,-35 60,-35 0,0 0,2 0,2z'/>");
out.println("<path d='M994 3231c0,0 41,-35 41,-35 0,0 -35,-167 -35,-167 0,0 42,-31 42,-31 0,0 -15,-75 -15,-75 0,0 54,-119 54,-119 0,0 98,-56 98,-56 0,0 2,2 2,2 0,0 -12,123 -12,123 0,0 85,25 85,25 0,0 13,75 13,75 0,0 60,2 60,2 0,0 33,29 33,29 0,0 -50,65 -50,65 0,0 11,39 11,39 0,0 6,48 6,48 0,0 -42,44 -42,44 0,0 3,29 3,29 0,0 -71,92 -71,92 0,0 -65,-2 -65,-2 0,0 -19,-55 -19,-55 0,0 -35,50 -35,50 0,0 -48,-8 -48,-8 0,0 -56,-73 -56,-73 0,0 0,-2 0,-2z'/>");
out.println("</g>");
out.println("</g>");
out.println("/svg");
} |
Partager