0
votes

But I didn't do this yet.

I have a div element

<div id="map" class="map"></div> 

And I have a map

    var map = new ol.Map({
    layers: [map_layer],
    target: 'map',
    view: Map_1_view
});

I try this to set target

$("#map").data("my_map",  map);

but it didn't work. How can I solve this?

1

1 Answers

1
votes

I solve this with

 map.setTarget($("#map")[0]);