tombatossals/angular-openlayers-directive

Setting center in defaults object has no effect

Closed this issue · 3 comments

Defining center property in defaults attribute seems to have no effect

After some debuging, i've found that setDefaults(scope) method doesn't read the center property of userDefaults object to merge the directive defaults with user defaults.

@Toilal I see. could you may submit a PR that fixes this problem with an according test case?

Also, you could maybe try setting it through the ol-center property:

<openlayers ol-center="vm.center">
   ...
</openlayers>

and center could be something like this:

vm.center = {
    autodiscover: false, // some browsers are making problems
    lat: 5886269.5,
    lon: 1272520,
    zoom: 10,
    projection: 'EPSG:3857',
    bounds: []
};

Please re-open the issue if it persists.