<commit_before>package org.gwt.leaflet.client.crs;

import org.gwt.leaflet.client.LeafletException;
import org.gwt.leaflet.client.crs.epsg.EPSG3395;
import org.gwt.leaflet.client.crs.epsg.EPSG3857;
import org.gwt.leaflet.client.crs.epsg.EPSG4326;
import org.gwt.leaflet.client.crs.epsg.Simple;
import org.gwt.leaflet.client.jswraps.JSObject;
import org.gwt.leaflet.client.types.LatLng;
import org.gwt.leaflet.client.types.Point;

/**
 * <b>Base {@link ICRS} implementation class</b>
 * <p>
 *  
 * @author kengu
 * @author <NAME>
 * 
 * @see @see <a href="http://leaflet.cloudmade.com/reference.html#icrs">L.CRS (Leaflet API)</a>
 *
 */
public class CRSImpl  {

	// --------------------------------------------------------
	// ICRS interface implementation
	// --------------------------------------------------------	
	public static native JSObject create(String code) /*-{
	    var EPSG4326 = @org.gwt.leaflet.client.crs.CRS::EPSG4326; 
	    var EPSG3395 = @org.gwt.leaflet.client.crs.CRS::EPSG3395;
	    var EPSG3857 = @org.gwt.leaflet.client.crs.CRS::EPSG3857;
	    var SIMPLE   = @org.gwt.leaflet.client.crs.CRS::SIMPLE;
	
	    var epsg
		if(code == EPSG4326) {
			epsg = $wnd.L.CRS.EPSG4326;
		}
		else if(code == EPSG3395) {
			epsg = $wnd.L.CRS.EPSG3395;
		}
		else if(code == EPSG3857) {
			epsg =  $wnd.L.CRS.EPSG3857;
		}
		else if(code == SIMPLE) {
			epsg  = $wnd.L.CRS.Simple;
			epsg.code = 'Simple';
		}
		alert(code + " : " +epsg + "/"+ epsg.code);
		return epsg;
		
	}-*/;
	
	private native static EPSG4326 newEPSG4326() /*-{
		return 
	}-*/;

	private native static EPSG3395 newEPSG3395() /*-{
		return 
	}-*/;

	private native static EPSG3857 newEPSG3857() /*-{
		return 
	}-*/;

	private native static Simple newSimple() /*-{
		
	}-*/;

	public static native String getCode() /*-{
		return this.code;
	}-*/;
	 
	
	public static native Point toPoint(LatLng coords, double zoom) /*-{
		return this.toPoint(coords,zoom);
	}-*/;
	
	public static native Point project(LatLng coords) /*-{
		return this.project(coords,zoom);
	}-*/;
	
	public static native LatLng toLatLng(Point point, double zoom) /*-{
		return this.toLatLng(point,zoom);
	}-*/;
	
	public static native double scale(double zoom) /*-{
		return this.scale(zoom);
	}-*/;
	
}<commit_msg>CRS Implementation<commit_after>package org.gwt.leaflet.client.crs;

import org.gwt.leaflet.client.LeafletException;
import org.gwt.leaflet.client.crs.epsg.EPSG3395;
import org.gwt.leaflet.client.crs.epsg.EPSG3857;
import org.gwt.leaflet.client.crs.epsg.EPSG4326;
import org.gwt.leaflet.client.crs.epsg.Simple;
import org.gwt.leaflet.client.jswraps.JSObject;
import org.gwt.leaflet.client.types.LatLng;
import org.gwt.leaflet.client.types.Point;

/**
 * <b>Base {@link ICRS} implementation class</b>
 * <p>
 *  
 * @author kengu
 * @author <NAME>
 * 
 * @see @see <a href="http://leaflet.cloudmade.com/reference.html#icrs">L.CRS (Leaflet API)</a>
 *
 */
public class CRSImpl  {

	// --------------------------------------------------------
	// ICRS interface implementation
	// --------------------------------------------------------	
	public static native JSObject create(String code) /*-{
	    var EPSG4326 = @org.gwt.leaflet.client.crs.CRS::EPSG4326; 
	    var EPSG3395 = @org.gwt.leaflet.client.crs.CRS::EPSG3395;
	    var EPSG3857 = @org.gwt.leaflet.client.crs.CRS::EPSG3857;
	    var SIMPLE   = @org.gwt.leaflet.client.crs.CRS::SIMPLE;
	
	    var epsg
		if(code == EPSG4326) {
			epsg = $wnd.L.CRS.EPSG4326;
		}
		else if(code == EPSG3395) {
			epsg = $wnd.L.CRS.EPSG3395;
		}
		else if(code == EPSG3857) {
			epsg =  $wnd.L.CRS.EPSG3857;
		}
		else if(code == SIMPLE) {
			epsg  = $wnd.L.CRS.Simple;
			epsg.code = 'Simple';
		}
		//alert(code + " : " +epsg + "/"+ epsg.code);
		return epsg;
		
	}-*/;
	
	public static native String getCode() /*-{
		return this.code;
	}-*/;
	 
	
	public static native Point toPoint(LatLng coords, double zoom) /*-{
		return this.toPoint(coords,zoom);
	}-*/;
	
	public static native Point project(LatLng coords) /*-{
		return this.project(coords,zoom);
	}-*/;
	
	public static native LatLng toLatLng(Point point, double zoom) /*-{
		return this.toLatLng(point,zoom);
	}-*/;
	
	public static native double scale(double zoom) /*-{
		return this.scale(zoom);
	}-*/;
	
}
{'fraction_non_alphanumeric': 0.20926966292134833, 'fraction_numerical': 0.033707865168539325, 'mean_word_length': 2.630416312659303, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6079217', 'n_tokens_mistral': 1891, 'n_tokens_neox': 1671, 'n_words': 282}