List of usage examples for com.google.gwt.maps.client.layers KmlLayer newInstance
public final static KmlLayer newInstance(String url, KmlLayerOptions options)
From source file:org.wannatrak.client.MapController.java
License:Apache License
public void showSubjects(Set<Long> subjects, String fromDaysAgo, String fromHour, String fromMinute, String toDaysAgo, String toHour, String toMinute, boolean showErrors, boolean updateOnlyNew) { final Set<Long> subjectsToShow; if (updateOnlyNew) { subjectsToShow = new HashSet<Long>(subjects); for (Iterator<Long> it = layers.keySet().iterator(); it.hasNext();) { Long subjectId = it.next(); if (!subjects.contains(subjectId)) { layers.get(subjectId).setMap(null); it.remove();/* w w w . ja va 2 s. c o m*/ } } } else { subjectsToShow = subjects; } for (final Long subjectId : subjectsToShow) { mediator.showSublectLoading(subjectId); String url = "http://" + Window.Location.getHost() + "/show?subjectId=" + subjectId + "&sessionId=" + Cookies.getCookie("JSESSIONID") + "&hfrom=" + fromHour + "&mfrom=" + fromMinute + "&dfrom=" + fromDaysAgo + "&hto=" + toHour + "&mto=" + toMinute + "&dto=" + toDaysAgo + "&valid=" + !showErrors + "&format=" + DateTimeFormat.getMediumDateTimeFormat().getPattern().replaceAll(" ", "_SPACE_") + "&tzoffset=" + new Date().getTimezoneOffset() + "&nocache=" + Random.nextInt(); options.setPreserveViewport(!updateOnlyNew); KmlLayer route = KmlLayer.newInstance(url, options); route.setMap(mapWidget); layers.put(subjectId, route); mediator.hideSubjectLoading(subjectId); } }