2013-05-31 111 views
0

你好我會改變地圖中的標記,我使用rails,並且我爲這個標記寫了這個javascript函數,所以如果我用url更改標記:「icona.png」其中icona.png其中icona.png位於同一個文件夾中資源促銷沒有在地圖上顯示我的標記。爲什麼?如何改變默認市場還有另一種方法?Rails如何更改Google地圖標記?

 function setMarkers(map, locations) { 
     // Add markers to the map 

     // Marker sizes are expressed as a Size of X,Y 
     // where the origin of the image (0,0) is located 
     // in the top left of the image. 

     // Origins, anchor positions and coordinates of the marker 
     // increase in the X direction to the right and in 
     // the Y direction down. 
     var image = { 
      url: "icona.png", 
      // This marker is 20 pixels wide by 32 pixels tall. 
      size: new google.maps.Size(20, 32), 
      // The origin for this image is 0,0. 
      origin: new google.maps.Point(0,0), 
      // The anchor for this image is the base of the flagpole at 0,32. 
      anchor: new google.maps.Point(0, 32) 
     }; 
     var shadow = { 
      url: "icona.png", 
      // The shadow image is larger in the horizontal dimension 
      // while the position and offset are the same as for the main image. 
      size: new google.maps.Size(37, 32), 
      origin: new google.maps.Point(0,0), 
      anchor: new google.maps.Point(0, 32) 
     }; 
     // Shapes define the clickable region of the icon. 
     // The type defines an HTML <area> element 'poly' which 
     // traces out a polygon as a series of X,Y points. The final 
     // coordinate closes the poly by connecting to the first 
     // coordinate. 
     var shape = { 
      coord: [1, 1, 1, 20, 18, 20, 18 , 1], 
      type: 'poly' 
     }; 

回答

相關問題