{"action":"created","issue":{"url":"https://api.github.com/repos/kartena/Proj4Leaflet/issues/68","repository_url":"https://api.github.com/repos/kartena/Proj4Leaflet","labels_url":"https://api.github.com/repos/kartena/Proj4Leaflet/issues/68/labels{/name}","comments_url":"https://api.github.com/repos/kartena/Proj4Leaflet/issues/68/comments","events_url":"https://api.github.com/repos/kartena/Proj4Leaflet/issues/68/events","html_url":"https://github.com/kartena/Proj4Leaflet/pull/68","id":32036738,"number":68,"title":"Add ImageOverlay that accepts bounds as projected coordinates","user":{"login":"perliedman","id":1246614,"avatar_url":"https://avatars.githubusercontent.com/u/1246614?v=3","gravatar_id":"","url":"https://api.github.com/users/perliedman","html_url":"https://github.com/perliedman","followers_url":"https://api.github.com/users/perliedman/followers","following_url":"https://api.github.com/users/perliedman/following{/other_user}","gists_url":"https://api.github.com/users/perliedman/gists{/gist_id}","starred_url":"https://api.github.com/users/perliedman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/perliedman/subscriptions","organizations_url":"https://api.github.com/users/perliedman/orgs","repos_url":"https://api.github.com/users/perliedman/repos","events_url":"https://api.github.com/users/perliedman/events{/privacy}","received_events_url":"https://api.github.com/users/perliedman/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2014-04-23T06:53:15Z","updated_at":"2016-09-15T10:51:25Z","closed_at":"2014-05-14T19:36:14Z","pull_request":{"url":"https://api.github.com/repos/kartena/Proj4Leaflet/pulls/68","html_url":"https://github.com/kartena/Proj4Leaflet/pull/68","diff_url":"https://github.com/kartena/Proj4Leaflet/pull/68.diff","patch_url":"https://github.com/kartena/Proj4Leaflet/pull/68.patch"},"body":"Adds class ```L.Proj.ImageOverlay```, that works exactly as ```L.ImageOverlay``` except that it takes the bounds in projected (map) coordinates instead of LatLngBounds. This makes it possible to add image overlays when working with coordinates systems where latitudes and longitudes do not align with the x and y axis (probably most projections). Inspired from the discussion in #67 and https://github.com/Leaflet/Leaflet/issues/2592."},"comment":{"url":"https://api.github.com/repos/kartena/Proj4Leaflet/issues/comments/247296612","html_url":"https://github.com/kartena/Proj4Leaflet/pull/68#issuecomment-247296612","issue_url":"https://api.github.com/repos/kartena/Proj4Leaflet/issues/68","id":247296612,"user":{"login":"theashyster","id":18593807,"avatar_url":"https://avatars.githubusercontent.com/u/18593807?v=3","gravatar_id":"","url":"https://api.github.com/users/theashyster","html_url":"https://github.com/theashyster","followers_url":"https://api.github.com/users/theashyster/followers","following_url":"https://api.github.com/users/theashyster/following{/other_user}","gists_url":"https://api.github.com/users/theashyster/gists{/gist_id}","starred_url":"https://api.github.com/users/theashyster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theashyster/subscriptions","organizations_url":"https://api.github.com/users/theashyster/orgs","repos_url":"https://api.github.com/users/theashyster/repos","events_url":"https://api.github.com/users/theashyster/events{/privacy}","received_events_url":"https://api.github.com/users/theashyster/received_events","type":"User","site_admin":false},"created_at":"2016-09-15T10:51:25Z","updated_at":"2016-09-15T10:51:25Z","body":"Hi, @perliedman \r\nI am curious if this shouldn't also be implemented in the `leaflet-proj-refactor` branch? Right now in the project I work on, I use a `CustomImageOverlay` layer that I have extended from `ImageOverlay` layer with basically all of the modifications you have done in this pull request.\r\n\r\nI switched to using soon to be `Leaflet 1.0` and noticed that the image overlays started to act strange, so I had to write an extended class that uses this code (and a couple of small modifications) to fix that, but it would be more elegant to just use the library without having to use my extended class.\r\n\r\nMy modifications for the code in this pull request to work with `Leaflet 1.0` is like this:\r\n```\r\n_animateZoom: function (event) {\r\n    var scale = this._map.getZoomScale(event.zoom);\r\n    var northWest = L.point(this._projBounds.min.x, this._projBounds.max.y);\r\n    var offset = this._projectedToNewLayerPoint(northWest, event.zoom, event.center);\r\n\r\n    L.DomUtil.setTransform(this._image, offset, scale);\r\n},\r\n\r\n_projectedToNewLayerPoint: function (point, zoom, center) {\r\n    var viewHalf = this._map.getSize()._divideBy(2);\r\n    var newTopLeft = this._map.project(center, zoom)._subtract(viewHalf)._round();\r\n    var topLeft = newTopLeft.add(this._map._getMapPanePos());\r\n\r\n    return this._transform(point, zoom)._subtract(topLeft);\r\n}\r\n```\r\n\r\nPlease take a look if this is of any help to you or what should I do to make a pull request that merges this into the `leaflet-proj-refactor` branch."}}
{"actor":{"display_login":"theashyster"}}