IEEE.org     |     IEEE Xplore Digital Library     |     IEEE Standards     |     IEEE Spectrum     |     More Sites

Commit 6a27dbd5 authored by jedjas12's avatar jedjas12
Browse files

Revereted code to clean & working map for PR

parent df910c62
......@@ -103,6 +103,7 @@ export default class GeoQuery extends LightningElement {
radius: rad
}).addTo(map);
// Query the open source database for assets that are within a radius of
// where the user clicked... this should go in a controller module and is only
// here because I was hacking this together for a demo
......
......@@ -17,7 +17,7 @@ export default class Map extends LightningElement {
* When this is complete, call initializeleaflet()
*/
connectedCallback() {
Promise.all([
loadScript(this, leaflet + '/leaflet.js'),
......@@ -29,6 +29,7 @@ export default class Map extends LightningElement {
});
}
/**
* Constructs the Leaflet map on the page and initializes this.map
*/
......@@ -41,37 +42,8 @@ export default class Map extends LightningElement {
this.map.setMaxZoom(17);
}
/**addDrawTools() {
//this.map.drawControl(true);
const drawnItems = new L.FeatureGroup();
this.map.addLayer(drawnItems);
const drawControl = new L.Control.Draw({
edit: {
featureGroup: drawnItems
}
});
L.control.drawControl(drawControl).addTo(this.map);
const toolbar = L.Toolbar();
const modifiedDraw = L.drawLocal.extend({
draw: {
toolbar: {
buttons: {
polygon: 'Draw a polygon!'
}
}
}
});
this.map.addLayer(modifiedDraw);
toolbar.addToolbar(this.map);
}*/
createToolbar() {
}
/**
* Setup the base OpenStreetMap tile layer
*/
......@@ -85,13 +57,5 @@ export default class Map extends LightningElement {
})
.addTo(this.map);
var drawnItems = new L.FeatureGroup();
this.map.addLayer(drawnItems);
var drawControl = new L.Control.Draw({
edit: {
featureGroup: drawnItems
}
});
this.map.addControl(drawControl);
}
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment