Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] Native layers #406

Open
oiacrasec opened this issue Sep 30, 2019 · 0 comments
Open

[Question] Native layers #406

oiacrasec opened this issue Sep 30, 2019 · 0 comments

Comments

@oiacrasec
Copy link

How can i access native layers from map?

olData.getMap('mymap').then(function (nativeOl3Map) {
    // only return the tile layer
    var layers = nativeOl3Map.getLayers();

    // show tile layer and principal layer
    // Principal layer is what i want but i cant access 
    var layers = nativeOl3Map.getLayers().getArray();
});

I was trying to getLayer to getSource to addFeatures
I only want add a lot of markers manually to avoid creating many DOM elements (ol-marker), because i think this is slowing down the performance.

I tried to add a native layer manually for test without success too:

olData.getMap('mymap').then(function (nativeOl3Map) {
    nativeOl3Map.addLayer(new vectorLayer(new vectorSource(new feature(geom point))));
});

This last example are only to demonstrate the logic, not the real code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant