Answer the question
In order to leave comments, you need to log in
How to generate json without body and success sections?
Good afternoon.
There is the following REST service method.
@GET
@Path("/getClient")
public Client getClient() {
Client result = (Client) getJsonFile("getClient.json", Client.class);
retrun result;
}
Answer the question
In order to leave comments, you need to log in
Split into an array by semicolon. Then split each element comma-with-space into an array of pairs of coordinates (they will be text strings "55.759906" and run through each one parseFloat
to become numbers:
var coords = "55.759906, 37.622242;50.455898, 30.521481";
coords = coords.split(';').map( e => e.split(', ').map(parseFloat));
//
// или вариант для старых браузеров:
coords = coords.split(';').map( function(e){ return e.split(', ').map(parseFloat)});
var coords = "55.759906, 37.622242;50.455898, 30.521481";
var temp = coords.match(/([0-9\.]+)\D*([0-9\.]+)\D*([0-9\.]+)\D*([0-9\.]+)/);
coords = , [temp[3], temp[4]]];
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question