    lon-field String->Integer
    lat-col-idx String->Integer
    lon-col-idx String->Integer}
-  ;; TODO - tried to use `query String-Dict` above, but got errors with json parsing for some reason
-  (let [testpts (java.util.ArrayList. [(java.util.ArrayList. [37.7785264 -122.3943527])
-                                       (java.util.ArrayList. [37.7853604 -122.4329151])
-                                       (java.util.ArrayList. [37.8001008 -122.4420084])
-                                       (java.util.ArrayList. [37.757088 -122.4209783])
-                                       (java.util.ArrayList. [37.7962227 -122.4115758])])
-        query-dict (clojure.walk/keywordize-keys (json/read-str (get-in request [:params :query])))
-        points-inside-box-query-details (query-with-inside-filter (:query query-dict) lat-field lon-field x y zoom)
-        points (driver/dataset-query points-inside-box-query-details {:executed_by *current-user-id*
-                                                                      :synchronously true})]
+  ;; TODO - tried to use `query String->Dict` above, but got errors with json parsing for some reason
+  (let [query-dict (clojure.walk/keywordize-keys (json/read-str (get-in request [:params :query])))
+        updated-query (assoc query-dict
+                             :query (query-with-inside-filter (:query query-dict) lat-field lon-field x y zoom))
+        result (driver/dataset-query updated-query {:executed_by *current-user-id*
+                                                    :synchronously true})
+        lat-lon-points (extract-points result)]
     ;; manual ring response here.  we simply create an inputstream from the byte[] of our image
     {:status  200
      :headers {"Content-Type" "image/png"}
      :body    (java.io.ByteArrayInputStream.
                 (.toByteArray
-                  (com.metabase.corvus.api.tiles.GoogleMapPinsOverlay. zoom testpts)))}))
+                  (com.metabase.corvus.api.tiles.GoogleMapPinsOverlay. zoom lat-lon-points)))}))
 
 
 (define-routes)

        lon (float (/ (- corner-x pixel-origin) pixel-per-lon-degree))
        lat-radians (/ (- corner-y pixel-origin) (* pixel-per-lon-radian -1))
        lat (radians-to-degrees (- (* 2 (java.lang.Math/atan (java.lang.Math/exp lat-radians)))
                                   (/ 2 (java.lang.Math/PI))))]
    {:lat lat
     :lon lon}))


(defn query-with-inside-filter
  "Add an 'Inside' filter to the given query to restrict results to a bounding box"
  [details lat-field-id lon-field-id x y zoom]
  (let [{top-lt-lat :lat top-lt-lon :lon} (tile-lat-lon x y zoom)

(def pixel-per-lon-degree (float (/ tile-size 360.0)))
(def pixel-per-lon-radian (float (/ tile-size (* 2 (java.lang.Math/PI)))))

(defn- radians-to-degrees [rad]
  (float (/ rad (float (/ (java.lang.Math/PI) 180)))))

(defn- tile-lat-lon
  "Get the Latitude & Longitude of the upper left corner of a given tile"
  [x y zoom]
  (let [num-tiles (bit-shift-left 1 zoom)
