Skip to content

Commit

Permalink
feat(demo): PIP UI tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
missinglink committed Jul 10, 2019
1 parent 3587a77 commit b25482e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
8 changes: 4 additions & 4 deletions server/demo/assets/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,10 @@ function setupMap (elementId, settings) {
iconSize: [40, 40], // size of the icon
iconAnchor: [10, 10] // point of the icon which will correspond to marker's location
})
var crosshair = new L.marker({
center: new L.LatLng(40.7259, -73.9805),
zoom: 12
}, { icon: crosshairIcon, interactive: false })
var crosshair = new L.marker(
[40.7259, -73.9805],
{ icon: crosshairIcon, interactive: false }
)
crosshair.addTo(map)

// Move the crosshair to the center of the map when the user pans
Expand Down
6 changes: 6 additions & 0 deletions server/demo/assets/pip.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ $('document').ready(function () {
return layer
}

function clearLayers (map) {
getMapLayer(map, 'geojson').clearLayers()
getMapLayer(map, 'labels').clearLayers()
}

function updateMap (map, res) {
let geojson = getMapLayer(map, 'geojson')
geojson.clearLayers()
Expand Down Expand Up @@ -95,6 +100,7 @@ $('document').ready(function () {
}

var map = document.querySelector('#map')._leaflet_map
map.on('movestart', function (e) { clearLayers(map) })
map.on('moveend', function (e) { pointInPolygon(map) })
map.on('resize', function (e) { pointInPolygon(map) })
$('#simplification').change(function () { pointInPolygon(map) })
Expand Down

0 comments on commit b25482e

Please sign in to comment.