//******************************************************************************
// 
// typical URL: 
//	https://2.aerial.maps.api.here.com/maptile/2.1/maptile/ace544f55e/hybrid.day/6/10/14/512/png8?app_id=bC4fb9WQfCCZfkxspD4z&app_code=K2Cpd_EKDzrZb1tz0zdpeQ&lg=eng&ppi=72&pview=DEF
//	https://4.aerial.maps.api.here.com/maptile/2.1/maptile/41a671e349/hybrid.day/12/1171/1756/512/png8?app_id=bC4fb9WQfCCZfkxspD4z&app_code=K2Cpd_EKDzrZb1tz0zdpeQ&lg=eng&ppi=72&pview=DEF
//  https://1.aerial.maps.api.here.com/maptile/2.1/maptile/ace148ee49/hybrid.day/ 9/143/188/ 512/png8?app_id=VgTVFr1a0ft1qGcLCVJ6&app_code=LJXqQ8ErW71UsRUK3R33Ow&lg=eng&ppi=72&pview=DEF
//  http://3.aerial.maps.api.here.com/maptile/2.1/maptile/ace148ee49/hybrid.day/9/145/218/256/png?app_id=VgTVFr1a0ft1qGcLCVJ6&app_code=LJXqQ8ErW71UsRUK3R33Ow&lg=eng&ppi=72&pview=DEF
//  http://4.aerial.maps.api.here.com/maptile/2.1/maptile/ace148ee49/hybrid.day/7/35/54/256  /png?app_id=bC4fb9WQfCCZfkxspD4z&app_code=K2Cpd_EKDzrZb1tz0zdpeQ&lg=eng&ppi=72&pview=DEF
// Breakdown:
//	Base: https://2.aerial.maps.api.here.com/maptile/2.1/maptile/
//	Version:	ace544f55e/
//	Map_Type/scheme:hybrid.day/   {note included in the BaseURL }
//	Zoom: 		6/
//	Map row/col: 	10/14/
//	resolution size:	512/
//	Image format:	png8?		{'png8', 'jpg', ??}
//	????:		app_id=bC4fb9WQfCCZfkxspD4z&app_code=K2Cpd_EKDzrZb1tz0zdpeQ&
//	Language?:	lg=eng&
//	Pts per inch:	ppi=72&  	{'72', '250', '320', '500'} - affects the text size, suggest 320
//	Political View:	pview=DEF
//
//******************************************************************************

var
  nurl: AnsiString;

begin 

  nurl := RegExprReplaceMatchSubStr(GetURLBase, 'https://1', 'http://'+inttostr( Random(4)+1 ) );
  ResultURL := RegExprReplaceMatchSubStr(nurl, 'Version', Version ) +IntToStr(GetZ-1)+ '/' + IntToStr(GetX) + '/' + IntToStr(GetY) + '/256/png?app_id=VgTVFr1a0ft1qGcLCVJ6&app_code=LJXqQ8ErW71UsRUK3R33Ow&lg=eng&ppi=72&pview=DEF';


end.

