Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function PointSource (args){
- ol.source.Vector.call(this, args);
- this.typeOfGeometry = 'Point';
- this.on('addfeature', function(e){
- if(e.feature.getGeometry() instanceof ol.geom.Point)
- console.log('point');
- else {
- console.log('no point');
- this.removeFeature(e.feature);
- }
- });
- }
- PointSource.prototype = Object.create(ol.source.Vector.prototype);
- PointSource.prototype.constructor = PointSource;
- var myPointsLayer = new ol.layer.Vector({
- source : new PointSource({...})
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement