New feature in gwty-leaflet: debug/prod mode.

We have added a new feature to gwty-leaflet: choosing whether the injected script is minified or no. LeafletResources class can be used to inject leaflet js/css directly from the Java code, and we think having an uniminified script can help in debugging and tracking errors directly in the browser. The new prototype for the whenReady method is:

public static void whenReady(boolean debug, OnloadCallbackFn function)

if debug flag is set to yes then the injected script will be unminified. For example:

//will inject leaflet-src.js instead of leaflet.js
LeafletResources.whenReady(true, 
				e -> 
		             {	 
	    MapOptions options = new MapOptions.Builder(L.latLng(52.485611, 13.416460), 11.0, 10.0)
	    		                       .maxZoom(400.0).build();	
		final Map map = L.map("map", options);
		L.tileLayer(MAP_URL, null).addTo(map);	

               return null;
              });

Archive

Blog Partners