<commit_before>module GMaps.Map where

import Control.Monad.Eff
import DomHelpers
import GMaps.LatLng
import GMaps.MapOptions

foreign import data Map :: *

foreign import gMap
  "function gMap(ele) {\
  \  return function(opts) {\
  \    return function() {\
  \      return (new google.maps.Map(ele, opts.values[0]));\
  \    };\
  \  };\
  \}" :: forall eff. Element -> MapOptions -> Eff eff Map


foreign import panTo
  "function panTo(map) {\
  \  return function(x) {\
  \    return function() {\
  \      map.panTo(x);\
  \      return;\
  \    };\
  \  };\
  \}" :: forall eff. Map -> LatLng -> Eff eff Unit
<commit_msg>clean up GMaps.Map a bit<commit_after>module GMaps.Map (Map (), gMap, panTo) where

import Control.Monad.Eff
import DomHelpers
import GMaps.LatLng
import GMaps.MapOptions

foreign import data Map :: *

foreign import gMapFFI
  "function gMapFFI(ele) {\
  \  return function(opts) {\
  \    return function() {\
  \      return (new google.maps.Map(ele, opts));\
  \    };\
  \  };\
  \}" :: forall eff. Element -> { zoom :: Number, center :: LatLng, mapTypeId :: String } -> Eff eff Map

gMap :: forall eff. Element -> MapOptions -> Eff eff Map
gMap e m = gMapFFI e (runMapOptions m)

foreign import panTo
  "function panTo(map) {\
  \  return function(x) {\
  \    return function() {\
  \      map.panTo(x);\
  \      return;\
  \    };\
  \  };\
  \}" :: forall eff. Map -> LatLng -> Eff eff Unit

{'fraction_non_alphanumeric': 0.15546218487394958, 'fraction_numerical': 0.0007002801120448179, 'mean_word_length': 2.3782505910165486, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6393498', 'n_tokens_mistral': 512, 'n_tokens_neox': 495, 'n_words': 133}