comparison src/djol/VectorStore.js @ 22:60f6493e2892

Added projection property to djol/VectorStore
author cin
date Wed, 06 Dec 2017 11:48:39 +0300
parents f0035923ff3e
children
comparison
equal deleted inserted replaced
21:7c22fc01fcec 22:60f6493e2892
31 */ 31 */
32 return declare( 32 return declare(
33 null, { 33 null, {
34 _source: null, // ol3.source.Vector 34 _source: null, // ol3.source.Vector
35 35
36 _projection: null,
37
36 _subscriptions: null, 38 _subscriptions: null,
37 39
38 constructor: function (opts) { 40 constructor: function (opts) {
39 safe.argumentNotNull(opts, "opts"); 41 safe.argumentNotNull(opts, "opts");
40 safe.argumentOfType( 42 safe.argumentOfType(
43 "opts.source"); 45 "opts.source");
44 46
45 var me = this; 47 var me = this;
46 48
47 me._source = opts.source; 49 me._source = opts.source;
50 if (opts.projection)
51 me._projection = ol.proj.get(opts.projection);
48 }, 52 },
49 53
50 getSource: function () { 54 getSource: function () {
51 return this._source; 55 return this._source;
56 },
57
58 getProjection: function() {
59 return this._projection;
52 }, 60 },
53 61
54 get: function (id) { 62 get: function (id) {
55 return this._source.getFeatureById(id); 63 return this._source.getFeatureById(id);
56 }, 64 },