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

How to add map.overlay to the map? #322

Closed zuhrasofyan closed 8 years ago

zuhrasofyan commented 8 years ago

Is there any way to use map.overlay functionality? I want to add a popup marker based on the point generated by geoserver. Usually, it goes to the point with this kind of code:

//test show popup
    var popup = new ol.Overlay({
      element: document.getElementById('popup')
    });
    //var position = data.coord;
    var map = new ol.Map({
      target: 'map'
    });
    map.addOverlay(popup);
    var staticPosition = ol.proj.transform([ 10609085.704948753, 618922.4317438678 ], 'EPSG:3857', 'EPSG:3857').map(function(c) {
        return c;
    });
    popup.setPosition(staticPosition);

but since I migrating to this angular-directive, I really do not have an idea how to include basic functionality that offered by openlayers.