Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

ajout d'une fonction pour charger la lib google

  • Loading branch information...
commit 73f0cc102fb2e0f7b00ae34baccb5ec612679ec7 1 parent ae1ccce
Thomas Recouvreux authored
Showing with 7 additions and 1 deletion.
  1. +1 −1  main.opa
  2. +6 −0 plugin/gmap.opa
2  main.opa
View
@@ -8,6 +8,7 @@ callback(lat,lng,_x,_y) =
Dom.transform([#lat <- <>{lat}</>, #lng <- <>{lng}</>])
main() =
+ do Gmap.init()
conf = {
map={
id = "map_canvas"
@@ -31,7 +32,6 @@ main() =
server = Server.simple_dispatch(| {~path ...} -> Resource.full_page(
"Gmap",
main(),
- <script src="http://maps.googleapis.com/maps/api/js?sensor=false"/>
<style type="text/css">
html, body \{
margin: 0;
6 plugin/gmap.opa
View
@@ -52,6 +52,12 @@ type Gmap.config = {
Gmap = {{
+ init() =
+ Resource.register_external_js("http://maps.googleapis.com/maps/api/js?sensor=false")
+
+ free() =
+ Resource.unregister_external_js("http://maps.googleapis.com/maps/api/js?sensor=false")
+
@private
to_js(o) = Json.serialize(OpaSerialize.Json.serialize(o))
Please sign in to comment.
Something went wrong with that request. Please try again.