{"action":"created","issue":{"url":"https://api.github.com/repos/tombatossals/angular-openlayers-directive/issues/123","labels_url":"https://api.github.com/repos/tombatossals/angular-openlayers-directive/issues/123/labels{/name}","comments_url":"https://api.github.com/repos/tombatossals/angular-openlayers-directive/issues/123/comments","events_url":"https://api.github.com/repos/tombatossals/angular-openlayers-directive/issues/123/events","html_url":"https://github.com/tombatossals/angular-openlayers-directive/issues/123","id":75623296,"number":123,"title":"GeoJSON with Style?","user":{"login":"juristr","id":542458,"avatar_url":"https://avatars.githubusercontent.com/u/542458?v=3","gravatar_id":"","url":"https://api.github.com/users/juristr","html_url":"https://github.com/juristr","followers_url":"https://api.github.com/users/juristr/followers","following_url":"https://api.github.com/users/juristr/following{/other_user}","gists_url":"https://api.github.com/users/juristr/gists{/gist_id}","starred_url":"https://api.github.com/users/juristr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juristr/subscriptions","organizations_url":"https://api.github.com/users/juristr/orgs","repos_url":"https://api.github.com/users/juristr/repos","events_url":"https://api.github.com/users/juristr/events{/privacy}","received_events_url":"https://api.github.com/users/juristr/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":14,"created_at":"2015-05-12T14:31:14Z","updated_at":"2015-08-14T10:33:22Z","closed_at":null,"body":"Hi,\r\n\r\nI am not sure if I just missed it somewhere from the docs, but is it possible to register a GeoJSON layer with a specific style?\r\n\r\nCurrently I can do something like\r\n\r\n```javascript\r\n{\r\n  source: {\r\n    type: 'GeoJSON',\r\n    geojson: {\r\n      object: {...}\r\n    }\r\n  }\r\n}\r\n```\r\n\r\nand register it with the angular-openlayers-directive. Is it possible to specify a style with this layer as well? Similar to what this ol3 code example does: https://astuntechnology.github.io/osgis-ol3-leaflet/ol3/02-GEOJSON.html\r\n\r\nUnfortunately, at the moment I have to do it like this:\r\n\r\n```\r\nolData.getMap().then(function(map) {\r\n  var layers = map.getLayers();\r\n\r\n  layers.forEach(function(layer) {\r\n    if (layer.get('name') === TEMPORARY_LAYER_NAME) {\r\n      var source = layer.getSource();\r\n\r\n     ...\r\n\r\n      layer.setStyle(new ol.style.Style({\r\n          // this should be doable through the openlayers directive somehow...\r\n          // for now it's simply a copy of its style\r\n          image: new ol.style.Icon({\r\n                anchor: [0.5, 1],\r\n                anchorXUnits: 'fraction',\r\n                anchorYUnits: 'fraction',\r\n                opacity: 0.90,\r\n                src: base64icon\r\n          })\r\n      }));\r\n    }\r\n  });\r\n});\r\n```\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/tombatossals/angular-openlayers-directive/issues/comments/131062692","html_url":"https://github.com/tombatossals/angular-openlayers-directive/issues/123#issuecomment-131062692","issue_url":"https://api.github.com/repos/tombatossals/angular-openlayers-directive/issues/123","id":131062692,"user":{"login":"Pedrazl","id":10074431,"avatar_url":"https://avatars.githubusercontent.com/u/10074431?v=3","gravatar_id":"","url":"https://api.github.com/users/Pedrazl","html_url":"https://github.com/Pedrazl","followers_url":"https://api.github.com/users/Pedrazl/followers","following_url":"https://api.github.com/users/Pedrazl/following{/other_user}","gists_url":"https://api.github.com/users/Pedrazl/gists{/gist_id}","starred_url":"https://api.github.com/users/Pedrazl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Pedrazl/subscriptions","organizations_url":"https://api.github.com/users/Pedrazl/orgs","repos_url":"https://api.github.com/users/Pedrazl/repos","events_url":"https://api.github.com/users/Pedrazl/events{/privacy}","received_events_url":"https://api.github.com/users/Pedrazl/received_events","type":"User","site_admin":false},"created_at":"2015-08-14T10:33:22Z","updated_at":"2015-08-14T10:33:22Z","body":"Hi @juristr \r\nHere you are a working plunkr with the bug we talked about:\r\nhttp://plnkr.co/edit/Djr53KYBsfyYROG8bNno?p=info\r\n"}}