if (proxy.GetService().indexOf("Rodoviaria") > -1)
{
plusRodoviaria = "_RODOVIARIA";
proxy.setService(proxy.GetService().replace("Rodoviaria", ""));
}
ConfigurationManager cm = ConfigurationManager.getInstance();
CRouteAPI route = new CRouteAPI(
cm.getAppSettings("Maquina"),
cm.getAppSettings("Server"),
11188,
cm.getAppSettings("dirOutPut"),
cm.getAppSettings("webOutPut"),
cm.getAppSettings("M_BASEDECARTA_ROTAS" + plusRodoviaria),
cm.getAppSettings("M_BASEDECARTA_MAPAS" + plusRodoviaria)
);
switch (getService(proxy.GetService()))
{
case getRoute:
o = Common.getArrayByJSon(proxy.getParameters("tjss"), new Class[] { RouteStop.class, RouteOptions.class });
RouteInfo ri = route.getRoute((RouteStop[])tranformToArrayList((Object[])o[0]).toArray(new RouteStop[0]), (RouteOptions)o[1], tk.getId());
respostaWs = Common.SerializeJSObject(ri);
break;
case getRouteTotals:
o = Common.getArrayByJSon(proxy.getParameters("tjss"), new Class[] { RouteStop.class, RouteOptions.class });
RouteTotals rt = route.getRouteTotals((RouteStop[])tranformToArrayList((Object[])o[0]).toArray(new RouteStop[0]), (RouteOptions)o[1], tk.getId());
respostaWs = Common.SerializeJSObject(rt);
break;
case getRouteDescription:
o = Common.getArrayByJSon(proxy.getParameters("tjss"), new Class[] { RouteStop.class, RouteOptions.class });
SegmentDescription[] sd = route.getRouteDescription((RouteStop[])tranformToArrayList((Object[])o[0]).toArray(new RouteStop[0]), (RouteOptions)o[1], tk.getId());
respostaWs = Common.SerializeJSObject(sd);
break;
case getRouteWithMap:
o = Common.getArrayByJSon(proxy.getParameters("tjss"), new Class[] { RouteStop.class, RouteOptions.class, MapOptions.class });
RouteInfo rwm = route.getRouteWithMap((RouteStop[])tranformToArrayList((Object[])o[0]).toArray(new RouteStop[0]), (RouteOptions)o[1], (MapOptions)o[2], tk.getId());
respostaWs = Common.SerializeJSObject(rwm);
break;
case getRouteSummary:
o = Common.getArrayByJSon(proxy.getParameters("tjss"), new Class[] { RouteStop.class, RouteOptions.class });
RouteSummary[] rs = route.getRouteSummary((RouteStop[])tranformToArrayList((Object[])o[0]).toArray(new RouteStop[0]), (RouteOptions)o[1], tk.getId());
respostaWs = Common.SerializeJSObject(rs);
break;
case setRouteFence:
o = Common.getArrayByJSon(proxy.getParameters("tjss"), new Class[] { String.class, Double.class });
boolean rotaSelecionada = route.setRouteFence((String)o[0],((Double)o[1]), tk.getId());
respostaWs = Common.SerializeJSObject(rotaSelecionada);
break;
case checkFence:
o = Common.getArrayByJSon(proxy.getParameters("tjss"), new Class[] { String.class, Point.class });
boolean dentro = route.checkFence((String)o[0], (Point)o[1], tk.getId());
respostaWs = Common.SerializeJSObject(dentro);
break;
case getCoords:
o = Common.getArrayByJSon(proxy.getParameters("tjss"), new Class[] { String.class, String.class, String.class });
Extent ext = new Extent();
MapSize msz = new MapSize();
String idroute = (String)o[0];
String ex = (String)o[1];
String ms = (String)o[2];
ext.setXMin(Double.parseDouble(ex.split(Pattern.quote("|"))[0].replace(",", ".")));
ext.setXMax(Double.parseDouble(ex.split(Pattern.quote("|"))[1].replace(",", ".")));
ext.setYMin(Double.parseDouble(ex.split(Pattern.quote("|"))[2].replace(",", ".")));
ext.setYMax(Double.parseDouble(ex.split(Pattern.quote("|"))[3].replace(",", ".")));
msz.setWidth(Integer.parseInt(ms.split(Pattern.quote("|"))[0].toString()));
msz.setHeight(Integer.parseInt(ms.split(Pattern.quote("|"))[1].toString()));
//CommonControls.
respostaWs = route.getRouteCoords(idroute, ext, msz, tk.getId(), cm.getAppSettings("M_BASEDECARTA_ROTAS" + plusRodoviaria));
break;
case getCoordsFull:
//o = Common.getArrayByJSon(proxy.getParameters("tjss"), new Class[] { String) });
// CommonRouteDeCarta croute = new CommonRouteDeCarta(cm.getAppSettings("Maquina"),