tombatossals / angular-openlayers-directive

AngularJS directive to embed an interact with maps managed by the OpenLayers library
http://tombatossals.github.io/angular-openlayers-directive/
MIT License
282 stars 183 forks source link

Setting center in defaults object has no effect #356

Closed Toilal closed 7 years ago

Toilal commented 7 years ago

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.

juristr commented 7 years ago

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

juristr commented 7 years ago

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: []
};
juristr commented 7 years ago

Please re-open the issue if it persists.