<commit_before>// EPSG:3857's proj definition
var proj3857 = '+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext  +no_defs';
var proj4 = proj4('WGS84', proj3857);

// define a custom projection object
var projection = {
  code : 'proj4-merc',  // code of the projection

  project : function (c) { // from wgs84 to EPSG3857
    var pc = proj4.forward(c.toArray());
    return new maptalks.Coordinate(pc);
  },

  unproject : function (pc) { // from EPSG3857 to wgs84
    var c = proj4.inverse(pc.toArray());
    return new maptalks.Coordinate(c);
  }
};

var map = new maptalks.Map('map', {<commit_msg>add measure in proj4 example<commit_after>// EPSG:3857's proj definition
var proj3857 = '+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext  +no_defs';
var proj4 = proj4('WGS84', proj3857);

// define a custom projection object
var projection = {
  code : 'proj4-merc',  // code of the projection

  project : function (c) { // from wgs84 to EPSG3857
    var pc = proj4.forward(c.toArray());
    return new maptalks.Coordinate(pc);
  },

  unproject : function (pc) { // from EPSG3857 to wgs84
    var c = proj4.inverse(pc.toArray());
    return new maptalks.Coordinate(c);
  },

  // tell projection how to measure
  // for cartesian coordinates change this to:
  // measure: 'identity'
  measure: 'EPSG:4326'
};

var map = new maptalks.Map('map', {
{'fraction_non_alphanumeric': 0.15128900949796473, 'fraction_numerical': 0.0807327001356852, 'mean_word_length': 3.6974522292993632, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5383811', 'n_tokens_mistral': 657, 'n_tokens_neox': 587, 'n_words': 149}