Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function map() {
- map = new ol.Map({
- controls: ol.control.defaults({
- attributionOptions: ({
- collapsible: true
- })
- }).extend([
- scaleLineControl, new escalaControl(), new quitarContorno()
- ]),
- logo: false,
- layers: layers,
- target: 'map',
- view: new ol.View({
- center:ol.proj.fromLonLat([-61.530766,-34.865575]),
- zoom: 7
- })
- });
- }
- function addInteraction() {
- var value = "polygon";
- noDraw();
- draw = new ol.interaction.Draw({
- source: source,
- type: "Polygon",
- });
- map.addInteraction(draw);
- draw.on('drawend', function(evt){
- var feature = evt.feature;
- var p = feature.getGeometry();
- var format = new ol.format.WKT();
- poligonoWKT = format.writeGeometry(p.transform(ol.proj.get('EPSG:3857'),ol.proj.get('EPSG:4326')));
- p.transform(ol.proj.get('EPSG:4326'),ol.proj.get('EPSG:3857'));
- console.log(poligonoWKT);
- noDraw();
- $("#listgrouparea").show();
- getArea();
- });
- }
Add Comment
Please, Sign In to add comment