[#244,view/map][m]: support for customizing rendering of map features in all ways supported by Leaflet - fixes #244.

* This automatically provides support for things like custom markers via
  pointToLayer etc

* Also a significant bugfix for a bug that surfaced when using different marker
  (like the CircleMarker) - and which took ~30m to track down. Bug was that the
  call to zoom (or, more specifically, call to getBounds) occurred before
  features were added to the map and getBounds for some objects (such as
  circles) requires map to exit (so you can do a projection!)
This commit is contained in:
Rufus Pollock
2012-10-23 00:19:59 +01:00
parent 84edf764a0
commit df935091fd
2 changed files with 68 additions and 14 deletions

View File

@@ -207,6 +207,26 @@ test('Popup - Custom', function () {
view.remove();
});
test('geoJsonLayerOptions', function () {
var dataset = GeoJSONFixture.getDataset();
var view = new recline.View.Map({
model: dataset
});
$('.fixtures').append(view.el);
view.geoJsonLayerOptions.point
view.geoJsonLayerOptions.pointToLayer = function(feature, latlng) {
var marker = new L.CircleMarker(latlng, { radius: 8 } );
marker.bindPopup(feature.properties.popupContent);
return marker;
}
view.render();
// TODO: test it somehow?
expect(0);
view.remove();
});
test('MapMenu', function () {
var dataset = Fixture.getDataset();
var controls = new recline.View.MapMenu({