             return { lat: lat, lng: lng }
 
         render: ->
-            last_marker = undefined
-
-            for datum in @collection.models
-                geopoint = @_geopoint( datum )
-
-                if not geopoint?
-                    continue
-
-                marker = L.marker( [geopoint.lat, geopoint.lng], {icon: mapIcon} )
-
-                html = ''
-                for key, value of datum.get( 'data' )#marker.data
-                    html += "<div><strong>#{key}:</strong> #{value}</div>"
-                marker.bindPopup( html )
-
-                @markers.addLayer( marker )
-                @clusters.addLayer( marker )
-
-                if datum.get( 'data' ).value?
-                    heatmap_value = datum.get( 'data' ).value
+          for datum in @collection.models
+            geopoint = @_geopoint( datum )
+            continue if not geopoint?
+            @_add_to_layers(datum, geopoint)
 
         _resize_map: () =>
             $( '#map' ).css( { 'height': ( @$el.parent().height() - 20 ) + 'px' } )

          # invalidateSize() doesn't work.
          @map._onResize()

        get_next_page: () ->

            @data_offset = @data_offset + 1
            selfie = @
            @collection.fetch(
                reset: false
                data:
                    geofield: @selected_header.name
                    bbox: @bounds.toBBoxString()
                    offset: @data_offset
                success: (collection, response, options) ->
                    if response.meta.pages > selfie.data_offset
                        selfie.get_next_page()
            )

        refresh_viewport: ( event ) =>
            # If we could not find any geofields or the user has not
            # specified an existing one, don't do anything with the
            # data.
            if not @selected_header?
                return

            @data_offset = 0

            # Everytime we move around, grab new data from the server and
            # refresh the viewport!
            @bounds = event.target.getBounds()

            selfie = @

            @collection.fetch(
                reset: true
                data:
                    geofield: @selected_header.name
                    bbox: @bounds.toBBoxString()
                success: (collection, response, options) ->
                    if response.meta.pages > 0
                        selfie.get_next_page()
            )

    return DataMapView
)

            @map.on( 'moveend', @refresh_viewport )

            # Clear all our markers when we get another set of markers.
            @collection.on( 'reset', =>
                @markers.clearLayers()
                @clusters.clearLayers() )
            @
