Sha256: f2e29a28372b1f7443cf503c7277d3d73d50ac7469d386f9ae115f4e83a4c098

Contents?: true

Size: 896 Bytes

Versions: 17

Compression:

Stored size: 896 Bytes

Contents

//= require leaflet.awesome-markers

var map = function(layer_constructor, map_tiles, div_id, center, zoom, marker_color, rawMarkers, should_fit_bounds) {
  klass = eval(layer_constructor)
  var layer = new klass(map_tiles);
  var map = new L.Map(div_id, {
      center: new L.LatLng(center[0], center[1]),
      zoom: zoom,
      attributionControl: false
  });
  L.control.attribution ({
    position: 'bottomright',
    prefix: false
  }).addTo(map);

  map.addLayer(layer);

  var venueIcon = L.AwesomeMarkers.icon({
    icon: 'star',
    prefix: 'fa',
    markerColor: marker_color
  })

  var markers = rawMarkers.map(function(m) {
    return L.marker([m.latitude, m.longitude], { title: m.title, icon: venueIcon}).bindPopup(m.popup);
  });
  var markerGroup = L.featureGroup(markers);
  markerGroup.addTo(map);

  if(should_fit_bounds) {
    map.fitBounds(markerGroup.getBounds());
  }
};

Version data entries

17 entries across 17 versions & 4 rubygems

Version Path
koalagator-3.0.0 app/assets/javascripts/calagator/mapping.js
koalagator-2.1.1 app/assets/javascripts/calagator/mapping.js
koalagator-2.1.0 app/assets/javascripts/calagator/mapping.js
koalagator-2.0.0 app/assets/javascripts/calagator/mapping.js
calagator2-2.1.1 app/assets/javascripts/calagator/mapping.js
calagator2-2.1.0 app/assets/javascripts/calagator/mapping.js
calagator2-2.0.0 app/assets/javascripts/calagator/mapping.js
calagator-2.0.0.pre.1 app/assets/javascripts/calagator/mapping.js
calagator-2.0.0.pre.0 app/assets/javascripts/calagator/mapping.js
calagator-1.1.0 app/assets/javascripts/calagator/mapping.js
calagator-1.0.0 app/assets/javascripts/calagator/mapping.js
grokus-1.0.0.9 app/assets/javascripts/calagator/mapping.js
grokus-1.0.0.8 app/assets/javascripts/calagator/mapping.js
grokus-1.0.0.7 app/assets/javascripts/calagator/mapping.js
grokus-1.0.0.6 app/assets/javascripts/calagator/mapping.js
grokus-1.0.0.5 app/assets/javascripts/calagator/mapping.js
calagator-1.0.0.rc3 app/assets/javascripts/calagator/mapping.js