angular-openlayers-directive
angular-openlayers-directive copied to clipboard
Add marker on the event click of map
hello i try to add a maker when i click in the map but I have an issu :the marker is added far form where i clicked in the map there is the code i use : $scope.$on('openlayers.map.singleclick', function(event, data) { var prj = ol.proj.transform([ data.coord[0], data.coord[1] ], data.projection, 'EPSG:4326').map(function(c) { return c.toFixed(4); }) $scope.$apply(function() { $scope.markers.push({ latitude: Number(prj[1]), longitude: Number(prj[0]) }) }); });
Maybe it's related to this: #298 @sathishatnet ?
i don t think so because when i change the resolution of the screen it s work fine .the probem occur in the first load