Skip to content

Commit

Permalink
leaflet update (#78)
Browse files Browse the repository at this point in the history
**This PR is created to track progress of leaflet update to v1.4.0.**

Before merging into master I want to figure out if we need these changes:
* [ ] McBen@b5b33fb#diff-66cb4ebaec98b864101ad1f5bcbda09e
  (even if we need this, I suppose that more cleaner way is to extend `L.Popup` in [`oms.js`] 
* [x] #69 (Do we ever need monkey patching here?)
* [x] 67c1741
  Do we need **replace** default icons? Wouldn't it be better just add our icons with own names?

Even after merge I propose do not delete the branch, in order to easy view our modifications to the external's code (see #70).

[`oms.js`]: https://github.com/IITC-CE/ingress-intel-total-conversion/blob/master/code/oms.js
  • Loading branch information
johnd0e authored and modos189 committed Mar 13, 2019
1 parent c25e173 commit 49a6c15
Show file tree
Hide file tree
Showing 4 changed files with 1,186 additions and 1,136 deletions.
30 changes: 30 additions & 0 deletions code/boot.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ window.setupMap = function() {
bounceAtZoomLimits: false,
preferCanvas: true // Set to true if Leaflet should draw things using Canvas instead of SVG
});
if (L.CRS.S2) { map.options.crs = L.CRS.S2; }

if (L.Path.CANVAS) {
// for canvas, 2% overdraw only - to help performance
Expand Down Expand Up @@ -636,6 +637,35 @@ window.extendLeaflet = function() {
return new L.DivIcon.ColoredSvg(color, options);
};

/* !!This block is commented out as it's unclear if we really need this patch
// See https://github.com/IITC-CE/ingress-intel-total-conversion/issues/122
// use the earth radius value used by the s2 geometry library
// this library is used in the ingress backend, so distance calculation, etc
// are far closer if we use the value from that
L.CRS.Earth.R = 6367000;
var s2SphericalMercator = L.Util.extend({}, L.Projection.SphericalMercator, {
R: window.EARTH_RADIUS,
bounds: (function () {
var d = window.EARTH_RADIUS * Math.PI;
return L.bounds([-d, -d], [d, d]);
})()
});
L.CRS.S2 = L.Util.extend({}, L.CRS.Earth, {
code: 'EPSG:S2',
projection: s2SphericalMercator,
transformation: (function () {
var scale = 0.5 / (Math.PI * s2SphericalMercator.R);
return L.transformation(scale, 0.5, -scale, 0.5);
}())
});
*/

// Fix Leaflet: handle touchcancel events in Draggable
L.Draggable.prototype._onDownOrig = L.Draggable.prototype._onDown;
L.Draggable.prototype._onDown = function(e) {
Expand Down
Loading

0 comments on commit 49a6c15

Please sign in to comment.