{"action":"created","issue":{"url":"https://api.github.com/repos/tomwayson/esri-angular-cli-example/issues/25","repository_url":"https://api.github.com/repos/tomwayson/esri-angular-cli-example","labels_url":"https://api.github.com/repos/tomwayson/esri-angular-cli-example/issues/25/labels{/name}","comments_url":"https://api.github.com/repos/tomwayson/esri-angular-cli-example/issues/25/comments","events_url":"https://api.github.com/repos/tomwayson/esri-angular-cli-example/issues/25/events","html_url":"https://github.com/tomwayson/esri-angular-cli-example/issues/25","id":203421497,"number":25,"title":"FeatureLayer","user":{"login":"dorianboulch","id":5851082,"avatar_url":"https://avatars.githubusercontent.com/u/5851082?v=3","gravatar_id":"","url":"https://api.github.com/users/dorianboulch","html_url":"https://github.com/dorianboulch","followers_url":"https://api.github.com/users/dorianboulch/followers","following_url":"https://api.github.com/users/dorianboulch/following{/other_user}","gists_url":"https://api.github.com/users/dorianboulch/gists{/gist_id}","starred_url":"https://api.github.com/users/dorianboulch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dorianboulch/subscriptions","organizations_url":"https://api.github.com/users/dorianboulch/orgs","repos_url":"https://api.github.com/users/dorianboulch/repos","events_url":"https://api.github.com/users/dorianboulch/events{/privacy}","received_events_url":"https://api.github.com/users/dorianboulch/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-01-26T16:41:50Z","updated_at":"2017-01-27T03:18:53Z","closed_at":null,"body":"I can't find how to add a FeatureLayer to the map, can you help me ?\r\nThanks"},"comment":{"url":"https://api.github.com/repos/tomwayson/esri-angular-cli-example/issues/comments/275580471","html_url":"https://github.com/tomwayson/esri-angular-cli-example/issues/25#issuecomment-275580471","issue_url":"https://api.github.com/repos/tomwayson/esri-angular-cli-example/issues/25","id":275580471,"user":{"login":"kgs916","id":2197094,"avatar_url":"https://avatars.githubusercontent.com/u/2197094?v=3","gravatar_id":"","url":"https://api.github.com/users/kgs916","html_url":"https://github.com/kgs916","followers_url":"https://api.github.com/users/kgs916/followers","following_url":"https://api.github.com/users/kgs916/following{/other_user}","gists_url":"https://api.github.com/users/kgs916/gists{/gist_id}","starred_url":"https://api.github.com/users/kgs916/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kgs916/subscriptions","organizations_url":"https://api.github.com/users/kgs916/orgs","repos_url":"https://api.github.com/users/kgs916/repos","events_url":"https://api.github.com/users/kgs916/events{/privacy}","received_events_url":"https://api.github.com/users/kgs916/received_events","type":"User","site_admin":false},"created_at":"2017-01-27T03:18:53Z","updated_at":"2017-01-27T03:18:53Z","body":"@dorianboulch, I should have an example or two of adding FeatureLayers into a map soon for #19.  However, basically what you need to do is use the EsriLoaderService to load in the ESRI modules that you need, create the FeatureLayer, and add it to your map.  It would look something like this:\r\n\r\n```\r\nthis.esriLoader.loadModules([\r\n  'esri/symbols/SimpleMarkerSymbol',\r\n  'esri/Color',\r\n  'esri/layers/FeatureLayer',\r\n  'esri/renderers/SimpleRenderer',\r\n  'esri/PopupTemplate'\r\n]).then(([\r\n  SimpleMarkerSymbol,\r\n  Color,\r\n  FeatureLayer,\r\n  SimpleRenderer,\r\n  PopupTemplate\r\n]: [\r\n    __esri.SimpleMarkerSymbolConstructor,\r\n    __esri.ColorConstructor,\r\n    __esri.FeatureLayerConstructor,\r\n    __esri.SimpleRendererConstructor,\r\n    __esri.PopupTemplateConstructor\r\n  ]) => {\r\n  const featureLayer = new FeatureLayer({\r\n    fields: fields,\r\n    objectIdField: 'ObjectID',\r\n    renderer: new SimpleRenderer({\r\n      symbol: new SimpleMarkerSymbol({ color: new Color(color) })\r\n    }),\r\n    spatialReference: {\r\n      wkid: 4326\r\n    },\r\n    geometryType: 'point',\r\n    popupTemplate: popupTemplate,\r\n    title: title,\r\n    id: id,\r\n    source: url\r\n  });\r\n\r\n  this.map.add(featureLayer);\r\n});\r\n```\r\n\r\nAgain, keep an eye on #19 as we will be adding some examples there."}}
{"actor":{"display_login":"kgs916"}}