I am trying to zoom into a map in a jface project. I've managed to parse out coordinates into string variables but when I press the 'zoom' button, the map goes all grey. The coordinates have already been parsed out as string variables.

I believe the error to be in this snippet of code specifically with the browserCommand:

String lat = parsename[1];

String lon = parsename[2];

String answer = lat + ":" + lon;

String browserCommand = String.format("zoom_map('" + answer+ "')");

getBrowser().execute(browserCommand);


I've also tried

String browserCommand = String.format("zoom_map('lat:lon')", lat, lon);

but to no avail.