{"action":"created","issue":{"url":"https://api.github.com/repos/openlayers/openlayers/issues/8464","repository_url":"https://api.github.com/repos/openlayers/openlayers","labels_url":"https://api.github.com/repos/openlayers/openlayers/issues/8464/labels{/name}","comments_url":"https://api.github.com/repos/openlayers/openlayers/issues/8464/comments","events_url":"https://api.github.com/repos/openlayers/openlayers/issues/8464/events","html_url":"https://github.com/openlayers/openlayers/pull/8464","id":345956240,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA0OTQ1MDMz","number":8464,"title":"[Needs review] Implemented ol.layer.Vector.setRenderMode() (fixes #8436)","user":{"login":"dennisguse","id":2820825,"node_id":"MDQ6VXNlcjI4MjA4MjU=","avatar_url":"https://avatars0.githubusercontent.com/u/2820825?v=4","gravatar_id":"","url":"https://api.github.com/users/dennisguse","html_url":"https://github.com/dennisguse","followers_url":"https://api.github.com/users/dennisguse/followers","following_url":"https://api.github.com/users/dennisguse/following{/other_user}","gists_url":"https://api.github.com/users/dennisguse/gists{/gist_id}","starred_url":"https://api.github.com/users/dennisguse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dennisguse/subscriptions","organizations_url":"https://api.github.com/users/dennisguse/orgs","repos_url":"https://api.github.com/users/dennisguse/repos","events_url":"https://api.github.com/users/dennisguse/events{/privacy}","received_events_url":"https://api.github.com/users/dennisguse/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-07-30T22:13:11Z","updated_at":"2018-08-01T20:49:11Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/openlayers/openlayers/pulls/8464","html_url":"https://github.com/openlayers/openlayers/pull/8464","diff_url":"https://github.com/openlayers/openlayers/pull/8464.diff","patch_url":"https://github.com/openlayers/openlayers/pull/8464.patch"},"body":"Added `ol.layer.Vector.setRenderModer()` that allows changing the `renderMode` after a `VectorLayer` was created.\r\nIn addition, `ol.renderer.Map` was extended to listen for changes of `ol.layer.Layer`.\r\nOn change the renderer for this layer is re-created.\r\n\r\n__ATTENTION:__\r\n`ol.renderer.Map` listens to `EventType.CHANGE`.\r\nTherefore, _any_ change of `ol.layer.Layer` will trigger re-creating the renderer.\r\nAs this also includes adding new features, this patch might have _serious_ implications on performance.\r\n\r\n__Solution:__\r\nListen to a specific event (e.g., Property.RENDER_MODE) and thus avoid unnecessary re-creating the renderer."},"comment":{"url":"https://api.github.com/repos/openlayers/openlayers/issues/comments/409717739","html_url":"https://github.com/openlayers/openlayers/pull/8464#issuecomment-409717739","issue_url":"https://api.github.com/repos/openlayers/openlayers/issues/8464","id":409717739,"node_id":"MDEyOklzc3VlQ29tbWVudDQwOTcxNzczOQ==","user":{"login":"dennisguse","id":2820825,"node_id":"MDQ6VXNlcjI4MjA4MjU=","avatar_url":"https://avatars0.githubusercontent.com/u/2820825?v=4","gravatar_id":"","url":"https://api.github.com/users/dennisguse","html_url":"https://github.com/dennisguse","followers_url":"https://api.github.com/users/dennisguse/followers","following_url":"https://api.github.com/users/dennisguse/following{/other_user}","gists_url":"https://api.github.com/users/dennisguse/gists{/gist_id}","starred_url":"https://api.github.com/users/dennisguse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dennisguse/subscriptions","organizations_url":"https://api.github.com/users/dennisguse/orgs","repos_url":"https://api.github.com/users/dennisguse/repos","events_url":"https://api.github.com/users/dennisguse/events{/privacy}","received_events_url":"https://api.github.com/users/dennisguse/received_events","type":"User","site_admin":false},"created_at":"2018-08-01T20:49:11Z","updated_at":"2018-08-01T20:49:11Z","author_association":"NONE","body":"I love the approach: cleaner and less code.\r\nBut there is a slight issue that does not occur using the event-based solution.\r\nThe map is not immediately updated and if zoomed/panned/rotated, the marker is removed and re-appears.\r\nI attached two videos (as ZIP): _changedEvent.webm_ and _property.webm_ showing the difference between the two solutions.\r\n\r\n(Without any debugging; it's too late):\r\nThe issues with the _property_ feels like a race condition.\r\n- the layer is _not_ immediately flagged as dirty and thus not re-rendered\r\n- renderer is removed while panning and thus the maker removed\r\n- as `getUpdateWhileAnimating() == false`, the update takes place _after_ zooming/panning/rotating\r\n\r\nTest case:\r\n1. Load KML (via DnD) using `defaultStyle: true`\r\n```\r\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<kml xmlns=\"http://www.opengis.net/kml/2.2\">\r\n  <Placemark>\r\n    <name>Simple placemark</name>\r\n    <description>Attached to the ground. Intelligently places itself \r\n       at the height of the underlying terrain.</description>\r\n    <Point>\r\n      <coordinates>-122.0822035425683,37.42228990140251,0</coordinates>\r\n    </Point>\r\n  </Placemark>\r\n</kml>\r\n```\r\n\r\n2. Rotate via `ol.interaction.DragRotateAndZoom()`\r\n__RESULT:__ Switching between 'image' and 'vector' (and vice versa): the rotation of the text is either fixed (to the map) or rotating (and thus readable)."}}
{"actor":{"display_login":"dennisguse"}}