Class vg.mapviewer.kiosk.Path

MapViewer's Path class.

  • Defined in: <src/com/visioglobe/kiosk/Path.js>
Class Summary
Constructor Attributes Constructor Name and Description
 
This object should be constructed from the MapViewer's addRoutingPath() method.

Method Summary

Class Detail

vg.mapviewer.kiosk.Path()
This object should be constructed from the MapViewer's addRoutingPath() method.
See:
vg.mapviewer.kiosk.Mapviewer#addRoutingPath

Method Detail

  • getInterpolatedPosition(t)
    returns interpolated point
    Parameters:
    {number} t
    between 0 and 1
    Since:
    1.7.11
  • getLength()
    returns length of path in local coordinates, takes into account turns
    Since:
    1.7.11
  • hide()
    This method is called to hide the Path.
  • remove()
    This method is called to remove the Path. It can no longer be added back. It should be called when the path will no longer be displayed.
  • setInterpolatedStartEnd(start, end)
    changes the path to start and end in the middle If start is smaller than end, the line is not displayed. It can be used to make the track increasing size (grow), or to show just a subsection of the track.
    		 subpath_animation_start = function() {
    			window.subpath_animation = jQuery({v: 0}).animate({v: 1}, 
    			{ 
    				duration: 10000, 
    				easing: 'linear',
    				step: function(v) { 
    					// how just a subsegment... change start and end for other effects
    					var length = mypath.getLength();
    					var displayLength = 10; // 3 meters
    					// just a segment of 3 meters
    					mypath.setInterpolatedStartEnd(v-displayLength/length,v);
    					pos = mypath.getInterpolatedPosition(v);
    					pos.radius = mapviewer.camera.position.radius;
    					mapviewer.camera.position = pos;
    				},
    				complete: function()
    				{
    					// follow path at the same altitude as you are
    					pos = mypath.getInterpolatedPosition(0);
    					pos.radius = mapviewer.camera.position.radius;
    					// move back camera, and restart
    			mapviewer.camera.goTo(pos,{animationDuration: 2000})
    			.done(subpath_animation_start);
    				}
    			});
    		}
    		subpath_animation_start();
    		// ...
    		subpath_animation.stop();
    Parameters:
    {number} start
    number between 0 and 1
    {number} end Optional, Default: 1.0
    number between 0 and 1
    Since:
    1.7.11
  • show()
    This method is called to show the Path.