mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Basic but hacky way to get events out of map
This commit is contained in:
@@ -1,7 +1,10 @@
|
||||
Darkswarm.controller "MapCtrl", ($scope, MapConfiguration)->
|
||||
Darkswarm.controller "MapCtrl", ($scope, MapConfiguration, OfnMap, Marker)->
|
||||
$scope.OfnMap = OfnMap
|
||||
console.log Marker
|
||||
window.Marker = Marker
|
||||
$scope.map =
|
||||
center:
|
||||
latitude: 45
|
||||
longitude: -73
|
||||
latitude: -37.775757
|
||||
longitude: 144.743663
|
||||
zoom: 8
|
||||
styles: MapConfiguration.options
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
module SharedHelper
|
||||
|
||||
def inject_json(name, partial)
|
||||
render "json/injection", name: name, partial: partial
|
||||
def inject_json(name, partial, opts = {})
|
||||
render "json/injection", {name: name, partial: partial}.merge(opts)
|
||||
end
|
||||
|
||||
def distributor_link_class(distributor)
|
||||
|
||||
@@ -1,5 +1,15 @@
|
||||
- content_for :scripts do
|
||||
%script{src: "//maps.googleapis.com/maps/api/js?sensor=false"}
|
||||
|
||||
= inject_json "enterprisesForMap" , "enterprises_for_map", collection: @enterprises
|
||||
|
||||
%map{"ng-controller" => "MapCtrl"}
|
||||
%google-map{center: "map.center", zoom: "map.zoom", styles: "map.styles"}
|
||||
%span{"ng-repeat" => "marker in OfnMap.enterprises"}
|
||||
{{ marker.visible }}
|
||||
|
||||
%google-map{center: "map.center", zoom: "map.zoom", styles: "map.styles", draggable: "true"}
|
||||
|
||||
%markers{models: "OfnMap.enterprises", fit: "true",
|
||||
coords: "'self'", icon: "'icon'", click: "'reveal'"}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user