2016-12-05 50 views
0

我必須改變我的商店定位器上的數字字母
我使用jQuery商店定位器。
你能幫我嗎?
這是一個代碼更改Lettere與數量列表jquery商店定位器

// Set up alpha character 
      var markerId = currentMarker.get('id'); 
      // Use dot markers instead of alpha if there are more than 26 locations 
      if (this.settings.disableAlphaMarkers === true || this.settings.storeLimit === -1 || this.settings.storeLimit > 26 || (this.settings.fullMapStart === true && firstRun === true && (isNaN(this.settings.fullMapStartListLimit) || this.settings.fullMapStartListLimit > 26 || this.settings.fullMapStartListLimit === -1))) { 
       indicator = markerId + 1; 
      } 
      else { 
       if (page > 0) { 
        indicator = String.fromCharCode('A'.charCodeAt(0) + (storeStart + markerId)); 
       } 
       else { 
        indicator = String.fromCharCode('A'.charCodeAt(0) + markerId); 
       } 
      } 

回答

0

... 4個月後,迷迷糊糊到了同樣的問題。以防萬一你沒有工作。

上面列出的代碼只會更改地圖標記標籤。所以,你需要修改代碼(因爲缺乏更好的字眼)的2塊:

1號地塊 - 原代碼

// Add markers and infowindows loop 
for (var y = 0; y <= storeNumToShow - 1; y++) { 
    var letter = ''; 

    if (page > 0) { 
     letter = String.fromCharCode('A'.charCodeAt(0) + (storeStart + y)); 
    } 
    else { 
     letter = String.fromCharCode('A'.charCodeAt(0) + y); 
    } 

1塊 - 修改後的代碼

// Add markers and infowindows loop 
for (var y = 0; y <= storeNumToShow - 1; y++) { 
    var letter = ''; 

    if (page > 0) { 
     letter = parseInt(1 + (storeStart + y)); 
    } 
    else { 
     letter = parseInt(1 + y); 
    } 

第二塊 - 原始(如上所列)。

第二塊 - 修改後的代碼

// Set up alpha character 
var markerId = currentMarker.get('id'); 
// Use dot markers instead of alpha if there are more than 26 locations 
if (this.settings.disableAlphaMarkers === true || this.settings.storeLimit === -1 || this.settings.storeLimit > 1000 || (this.settings.fullMapStart === true && firstRun === true && (isNaN(this.settings.fullMapStartListLimit) || this.settings.fullMapStartListLimit > 1000 || this.settings.fullMapStartListLimit === -1))) { 
    indicator = markerId + 1; 
} 
else { 
    if (page > 0) { 
     indicator = parseInt(1 + (storeStart + markerId)); 
    } 
    else { 
     indicator = parseInt(1 + markerId); 
    } 
} 

請注意,雖然這種用數字作爲標籤,我沒有禁用字母標記(「disableAlphaMarkers」留在默認情況下,假的)。如果您有超過26個地點,您還需要更改26個商店限制。