Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

YNTELYGIENT marker drawing

  • Loading branch information...
commit c6b877d6e5aeedcc810c46bc44d1b70ab12f4052 1 parent b174547
Paweł Romanowski authored
View
6 citypulse/main/static/js/maps/controller.coffee
@@ -21,17 +21,17 @@ class citypulse.Controller
for model in collection.models
location = model.get("location")
content = model.get("title") + '<br/>' + model.get("data").text
- @view.showWindow(content, location[0], location[1],
+ @view.showWindow(content, model.id, location[0], location[1],
"pulse")
eventsChanged: (collection, resp) =>
for model in collection.models
location = model.get("location")
- @view.showWindow(model.get("title"), location[0], location[1],
+ @view.showWindow(model.get("title"), model.id, location[0], location[1],
"event")
venuesChanged: (collection, resp) =>
for model in collection.models
location = model.get("location")
- @view.showWindow(model.get("title"), location[0], location[1],
+ @view.showWindow(model.get("title"), model.id, location[0], location[1],
"venue")
View
6 citypulse/main/static/js/maps/models.coffee
@@ -4,13 +4,13 @@ class citypulse.models.BaseModel extends Backbone.Model
idAttribute: "resource_uri"
class citypulse.models.Pulse extends citypulse.models.BaseModel
- idAttribute: "resource_uri"
+ # pass
class citypulse.models.Event extends citypulse.models.BaseModel
- idAttribute: "resource_uri"
+ # pass
class citypulse.models.Venue extends citypulse.models.BaseModel
- idAttribute: "resource_uri"
+ # pass
class citypulse.models.BaseCollection extends Backbone.Collection
View
30 citypulse/main/static/js/maps/views.coffee
@@ -1,5 +1,24 @@
citypulse.views = {}
+
+#class citypulse.views.Marker
+# constructor: (@lat, @lng, @type, @map, @mc) ->
+#
+# @marker = new StyledMarker
+# styleIcon: new StyledIcon(StyledIconTypes.MARKER,
+# {color: "ff0000", text: "P"})
+# position: point
+# map: @map
+#
+# localWindow = new google.maps.InfoWindow(content: con)
+# google.maps.event.addListener(marker, 'click', =>
+# @hideWindow()
+# @activeWindow = localWindow
+# @map.panTo(marker.getPosition())
+# localWindow.open(@map, marker))
+
+
+
class citypulse.views.MapView extends Backbone.View
constructor: (@map) ->
@@ -10,11 +29,13 @@ class citypulse.views.MapView extends Backbone.View
google.maps.event.addListener(map, 'zoom_changed', @notifyChange)
google.maps.event.addListenerOnce(map, "idle", @notifyChange)
+ @markerMap = {}
+
#pass
drag: =>
- @mc.clearMarkers()
+ #@mc.clearMarkers()
notifyChange: =>
@@ -42,7 +63,12 @@ class citypulse.views.MapView extends Backbone.View
hideWindow: () =>
@activeWindow?.close()
- showWindow: (con, lat, lng, type) =>
+ showWindow: (con, uid, lat, lng, type) =>
+ if uid of @markerMap
+ return
+
+ @markerMap[uid] = true
+
point = new google.maps.LatLng(lat, lng)
switch type
Please sign in to comment.
Something went wrong with that request. Please try again.