Jim's
Tutorials

Spring 2015
course
navigation
I've made decent progress this week. The trail width and dash array now change with the zoom in. I couldn't get the static labels to work properly so I eventually decided to make a circle on each building (appears on zoom 18), when clicked it shows the building name.
The issue I was running into with the static label (no marker attachment) was that the names weren't always displaying over their defined coordinates. They were mostly stacking under Admissions. When I did use a marker, only the marker showed and the labels were nowhere in sight. Drawing a small circle over each coordinate pair avoided the misplacement issue. However as stated here http://stackoverflow.com/questions/17798794/how-to-display-leaflet-static-labels-for-objects-in-a-layergroup and here https://github.com/Leaflet/Leaflet.label/issues/31 , the static label (or noHide:true option doesn't seem to exist yet for circle markers).
I also added some pictures. These are depicted by a Leaflet circleMarker (http://leafletjs.com/reference.html#circlemarker ). I am having some problems overwriting the default settings (lines 111 and 163 in my code http://cs.marlboro.edu/~agoren/web_gis/plan_work/draw_MarlboroMap5.js ). The default is supposed to keep the pop-up in view - that is, scroll the map up so the full pop-up is visible - however, this does not seem to be working even when I specifically define "keepInView = true". The documentation for pop-ups is found here http://leafletjs.com/reference.html#popup and the bindPopup method that I am using is found under Methods here http://leafletjs.com/reference.html#path-options .
I also finally got around to walking (most) of South Pond Loop, I will finish the last bit (south road to town trail) this week. I've drawn what I have thus far in OSM. All that's left to do now is fill in the missing piece and export it so I can convert the .osm file to a .csv and add it to my trails file.
Oh, and here are is some discussion on keeping popups in view http://stackoverflow.com/questions/21029255/leaflet-marker-popup-extends-past-the-map . If you click on the "full example" at the bottom of this page http://leafletjs.com/examples/custom-icons.html , you can see that when you scroll up so that the leaves are nearly out of the bounds, when they are clicked, the map pans to show the pop-up.
http://cs.marlboro.edu/ courses/ spring2015/jims_tutorials/ agoren/ Apr_23
last modified Thursday April 23 2015 11:13 am EDT