Permalink
Browse files

add draggable marker

  • Loading branch information...
1 parent 132e72f commit b593f0d7f85d382293f1ef283578e5660404b88d @zucay committed May 25, 2012
Showing with 20 additions and 8 deletions.
  1. +20 −8 app/assets/javascripts/pointing.js.coffee
@@ -3,13 +3,25 @@
# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
window.onload = ->
- #地図を初期化
- map = new Y.Map("ymap")
+ #地図を初期化
+ map = new Y.Map("ymap", {
+ configure :{doubleClickPan : true}
+ })
- #コントロールの追加
- map.addControl(new Y.LayerSetControl())
- map.addControl(new Y.ZoomControl())
+ #コントロールの追加
+ map.addControl(new Y.LayerSetControl())
+ map.addControl(new Y.ZoomControl())
+ #map.addControl(new Y.CenterMarkControl())
+ map.addControl(new Y.ScaleControl())
+ map.addControl(new Y.SearchControl())
- #地図を表示
- map.drawMap(new Y.LatLng(35.665627,139.730738), 18,Y.LayerSetId.NORMAL)
- return
+ #地図を表示
+ map.drawMap(new Y.LatLng(35.665627,139.730738), 18,Y.LayerSetId.NORMAL)
+
+ #マーカーの追加
+ marker = new Y.Marker(map.getCenter())
+ marker.setDraggable(true)
+
+ map.addFeature(marker)
+
+ return

0 comments on commit b593f0d

Please sign in to comment.