{"action":"created","issue":{"url":"https://api.github.com/repos/KoRiGaN/Vue2Leaflet/issues/280","repository_url":"https://api.github.com/repos/KoRiGaN/Vue2Leaflet","labels_url":"https://api.github.com/repos/KoRiGaN/Vue2Leaflet/issues/280/labels{/name}","comments_url":"https://api.github.com/repos/KoRiGaN/Vue2Leaflet/issues/280/comments","events_url":"https://api.github.com/repos/KoRiGaN/Vue2Leaflet/issues/280/events","html_url":"https://github.com/KoRiGaN/Vue2Leaflet/issues/280","id":379472050,"node_id":"MDU6SXNzdWUzNzk0NzIwNTA=","number":280,"title":"Set view based on url attributes","user":{"login":"X1machinemaker1X","id":15055071,"node_id":"MDQ6VXNlcjE1MDU1MDcx","avatar_url":"https://avatars2.githubusercontent.com/u/15055071?v=4","gravatar_id":"","url":"https://api.github.com/users/X1machinemaker1X","html_url":"https://github.com/X1machinemaker1X","followers_url":"https://api.github.com/users/X1machinemaker1X/followers","following_url":"https://api.github.com/users/X1machinemaker1X/following{/other_user}","gists_url":"https://api.github.com/users/X1machinemaker1X/gists{/gist_id}","starred_url":"https://api.github.com/users/X1machinemaker1X/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/X1machinemaker1X/subscriptions","organizations_url":"https://api.github.com/users/X1machinemaker1X/orgs","repos_url":"https://api.github.com/users/X1machinemaker1X/repos","events_url":"https://api.github.com/users/X1machinemaker1X/events{/privacy}","received_events_url":"https://api.github.com/users/X1machinemaker1X/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-11-10T23:25:18Z","updated_at":"2018-11-16T07:56:31Z","closed_at":null,"author_association":"NONE","body":"So im trying to get the map to change views when the map is loaded with lat and lng values in the url. Im just not sure where to have the map change view. I tried in vue's mounted() and in the $nextTick() but the map just seems to reset to the default view. ik the map moves by listening to the move event so something definitely happens. \r\n\r\nTLDR: When should I set the view so that it is the final state presented to the viewer?"},"comment":{"url":"https://api.github.com/repos/KoRiGaN/Vue2Leaflet/issues/comments/439311278","html_url":"https://github.com/KoRiGaN/Vue2Leaflet/issues/280#issuecomment-439311278","issue_url":"https://api.github.com/repos/KoRiGaN/Vue2Leaflet/issues/280","id":439311278,"node_id":"MDEyOklzc3VlQ29tbWVudDQzOTMxMTI3OA==","user":{"login":"lordfuoco","id":5890166,"node_id":"MDQ6VXNlcjU4OTAxNjY=","avatar_url":"https://avatars3.githubusercontent.com/u/5890166?v=4","gravatar_id":"","url":"https://api.github.com/users/lordfuoco","html_url":"https://github.com/lordfuoco","followers_url":"https://api.github.com/users/lordfuoco/followers","following_url":"https://api.github.com/users/lordfuoco/following{/other_user}","gists_url":"https://api.github.com/users/lordfuoco/gists{/gist_id}","starred_url":"https://api.github.com/users/lordfuoco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lordfuoco/subscriptions","organizations_url":"https://api.github.com/users/lordfuoco/orgs","repos_url":"https://api.github.com/users/lordfuoco/repos","events_url":"https://api.github.com/users/lordfuoco/events{/privacy}","received_events_url":"https://api.github.com/users/lordfuoco/received_events","type":"User","site_admin":false},"created_at":"2018-11-16T07:56:31Z","updated_at":"2018-11-16T07:56:31Z","author_association":"COLLABORATOR","body":"@X1machinemaker1X so my suggestion would be:\r\n\r\n- create a property in data called `mapReady: false`\r\n- add the `leaflet:load` event to map `@leaflet:load=\"mapReady=true\"`\r\n- make a computed property as follows: \r\n```\r\nrealCenter () {\r\n   if(this.mapReady) {\r\n       return [this.$route.query.lat, this.$route.query.lon]\r\n    }\r\n    return this.center;\r\n}\r\n```\r\n- bind `realCenter` to the `:center=\"\"` prop on the `l-map`\r\n\r\n\r\nSorry if it took a while, let me know if you are able to solve like this \r\n"}}
{"actor":{"display_login":"lordfuoco"}}