Font size
WorksheetsModules 1.1-1.2 Questions
Total questions: 19
Worksheet time: 10mins
Which Leaflet method initializes a map in a given HTML element?
L.map('map')
L.initMap()
L.createMap('map')
map.new()
How do you set a Leaflet map view to a specific location and zoom level?
map.setView([lat, lng], zoom)
map.setLocation(lat, lng, zoom)
map.view(lat, lng, zoom)
map.zoom(lat, lng)
Which method is used to add a tile layer to a Leaflet map?
L.tileLayer(...).addTo(map)
map.addTile(...)
L.mapTile(...)
map.loadTiles(...)
Which URL pattern is correct for most Leaflet tile layers?
'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png'
'https://osm.org/{x}/{y}/{z}.jpg'
'https://tiles.org/zxy/{z}/{x}/{y}'
'https://maps.com/tiles/{zoom}/{lat}/{lng}'
Which function creates a map marker at a specified location?
L.marker([lat, lng])
L.point([lat, lng])
How do you bind a popup to a marker?
marker.bindPopup('text')
marker.addPopup('text')
popup.attachTo(marker)
marker.setPopup('text')
Which method shows a tooltip when hovering over a marker?
bindTooltip(...)
bindHover(...)
attachTooltip(...)
addTooltip(...)
What Leaflet method opens a popup on a specific map coordinate?
L.popup().setLatLng(...).setContent(...).openOn(map)
map.popup(...)
L.showPopup(...).open()
popup.trigger(map)
Which Leaflet function draws a polyline?
L.polyline([...])
L.line([...])
L.path([...])
L.drawLine([...])
To style a polyline with a dashed stroke, which option should you use?
(a)
Which function draws a polygon on a Leaflet map?
L.polygon([...])
L.polyline([...])
L.shape([...])
L.boundary([...])
How do you set a polygon's fill opacity?
polygon.setStyle({ fillOpacity: 0.3 })
polygon.fillOpacity(0.3)
polygon.setOpacity(0.3)
polygon.style.fill(0.3)
How do you create a circle with a radius of 250 meters?
L.circle([lat, lng], { radius: 250 })
L.circle([lat, lng], 250)
L.buffer([lat, lng], 250)
L.radiusCircle([lat, lng], 250)
Which Leaflet class is used to group multiple layers together?
L.layerGroup([...])
L.groupLayers([...])
L.layerBundle([...])
L.multiLayer([...])
Q15. The method that hides a layer group from the map is:
setVisible(false)
addLayer()
setOpacity(1)
removeFeature()
What method adds a previously removed group back to the map?
group.addTo(map)
map.show(group)
group.enable()
map.attach(group)
Which class would you use to create a group with shared event handling?
L.featureGroup([...])
L.layerGroup([...])
L.eventGroup([...])
L.controlGroup([...])
What is the purpose of using `.addTo(map)` at the end of a layer?
It adds the layer to the map
It makes the map clickable
It zooms to the layer
It centers the map
Which order of operations is correct when creating and styling a polygon?
Create -> Add to map -> Style -> Bind popup
Style -> Bind popup -> Create -> Add
Bind popup -> Style -> Create -> Add
Create -> Style -> Bind -> Skip add
