Always center map on marker
authorJohn Firebaugh <john.firebaugh@gmail.com>
Tue, 30 Jul 2013 20:44:49 +0000 (13:44 -0700)
committerJohn Firebaugh <john.firebaugh@gmail.com>
Mon, 5 Aug 2013 15:31:46 +0000 (08:31 -0700)
Not centering is of dubious usefulness, and doesn't work
at all with a short link.

app/assets/javascripts/leaflet.share.js

index 4454f02bbddd917b7bff598f600ad793398e818d..62572cf695a0f626caf7a12fb866fcc0b1b78d0f 100644 (file)
@@ -61,20 +61,6 @@ L.OSM.share = function (options) {
               .bind('change', toggleMarker))
           .append(I18n.t('javascripts.share.include_marker')));
 
-    $('<div>')
-      .attr('class', 'form-row')
-      .appendTo($form)
-      .append(
-        $('<label>')
-          .attr('for', 'center_marker')
-          .append(
-            $('<input>')
-              .attr('id', 'center_marker')
-              .attr('type', 'checkbox')
-              .prop('checked', true)
-              .bind('change', update))
-          .append(I18n.t('javascripts.share.center_marker')));
-
     $('<div>')
       .attr('class', 'form-row')
       .appendTo($form)
@@ -267,7 +253,7 @@ L.OSM.share = function (options) {
     }
 
     function update() {
-      if (map.hasLayer(marker) && $('#center_marker').is(':checked')) {
+      if (map.hasLayer(marker)) {
         map.panTo(marker.getLatLng());
       }
 
@@ -276,9 +262,6 @@ L.OSM.share = function (options) {
       $('#link_marker')
         .prop('checked', map.hasLayer(marker));
 
-      $('#center_marker')
-        .prop('disabled', !map.hasLayer(marker));
-
       $('#image_filter')
         .prop('checked', locationFilter.isEnabled());