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?


I solve this with


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.