{ Dev Farm }

Web & Windows Development

Last track not showing when gpx contains multiple tracks

Home Forum Wp Gpx Maps Support Last track not showing when gpx contains multiple tracks

  • Questo topic ha 2 risposte, 2 partecipanti ed è stato aggiornato l'ultima volta 5 anni, 4 mesi fa da max.
Stai visualizzando 3 post - dal 1 a 3 (di 3 totali)
  • Autore
    Post
  • #81216 Rispondi
    sjoerd
    Ospite

    Hi,

    I quite often use gpx-files containing multiple tracks and recently I noticed that the last track is never rendered when there is more then one track. I assume the is somewhere a < in the code which should have been <= or something. Could u please take a look at it

    I added a page to my site : http://boxer.gs/wp-gpx-map-bug/

    Please advice.

    Apart from this – greate plugin!

    Regards
    Sjoerd

    #81218 Rispondi
    sjoerd
    Ospite

    Oh –

    I found it (been through this all day). Did not realize there were also jscript files so:

    Line xx of WP-GPX-Maps.js should be as follows:

    for (i=0; i <= mapData.length; i++)

    is was

    for (i=0; i < mapData.length; i++)

    Please tell me if this correct – it works tho

    Regards,
    Sjoerd

    #82254 Rispondi
    max
    Amministratore del forum

    That might be a nice trick but I believe it’s better to correct the function like this:

    		DividePolylinesPoints : function (mapData)
    		{
    
    			var lastCut = 0;
    			
    			var result = [];
    			
    			var _len = mapData.length;
    		
    			for (i=0; i < _len; i++) 
    			{	
    				if (mapData == null)
    				{
    					result.push( mapData.slice(lastCut == 0 ? 0 : lastCut + 1 ,i) );
    					lastCut = i;
    				}
    			}
    			
    			if ( (_len - 1 ) != lastCut)
    			{
    				result.push( mapData.slice(lastCut) );
    			}
    		
    			return result;
    			
    		},
Stai visualizzando 3 post - dal 1 a 3 (di 3 totali)
Rispondi a: Risposta #82254 in Last track not showing when gpx contains multiple tracks

You can use BBCodes to format your content.
Your account can't use Advanced BBCodes, they will be stripped before saving.

Le tue informazioni:




Non è possibile lasciare nuovi commenti.