i had a situation where i can't change old code, so added this javascript function to calculate center point and zoom level:
//input_x000D_
var tempdata = ["18.9400|72.8200-19.1717|72.9560-28.6139|77.2090"];_x000D_
_x000D_
function getCenterPosition(tempdata){_x000D_
var tempLat = tempdata[0].split("-");_x000D_
var latitudearray = [];_x000D_
var longitudearray = [];_x000D_
var i;_x000D_
for(i=0; i<tempLat.length;i++){_x000D_
var coordinates = tempLat[i].split("|");_x000D_
latitudearray.push(coordinates[0]);_x000D_
longitudearray.push(coordinates[1]);_x000D_
}_x000D_
latitudearray.sort(function (a, b) { return a-b; });_x000D_
longitudearray.sort(function (a, b) { return a-b; });_x000D_
var latdifferenece = latitudearray[latitudearray.length-1] - latitudearray[0];_x000D_
var temp = (latdifferenece / 2).toFixed(4) ;_x000D_
var latitudeMid = parseFloat(latitudearray[0]) + parseFloat(temp);_x000D_
var longidifferenece = longitudearray[longitudearray.length-1] - longitudearray[0];_x000D_
temp = (longidifferenece / 2).toFixed(4) ;_x000D_
var longitudeMid = parseFloat(longitudearray[0]) + parseFloat(temp);_x000D_
var maxdifference = (latdifferenece > longidifferenece)? latdifferenece : longidifferenece;_x000D_
var zoomvalue; _x000D_
if(maxdifference >= 0 && maxdifference <= 0.0037) //zoom 17_x000D_
zoomvalue='17';_x000D_
else if(maxdifference > 0.0037 && maxdifference <= 0.0070) //zoom 16_x000D_
zoomvalue='16';_x000D_
else if(maxdifference > 0.0070 && maxdifference <= 0.0130) //zoom 15_x000D_
zoomvalue='15';_x000D_
else if(maxdifference > 0.0130 && maxdifference <= 0.0290) //zoom 14_x000D_
zoomvalue='14';_x000D_
else if(maxdifference > 0.0290 && maxdifference <= 0.0550) //zoom 13_x000D_
zoomvalue='13';_x000D_
else if(maxdifference > 0.0550 && maxdifference <= 0.1200) //zoom 12_x000D_
zoomvalue='12';_x000D_
else if(maxdifference > 0.1200 && maxdifference <= 0.4640) //zoom 10_x000D_
zoomvalue='10';_x000D_
else if(maxdifference > 0.4640 && maxdifference <= 1.8580) //zoom 8_x000D_
zoomvalue='8';_x000D_
else if(maxdifference > 1.8580 && maxdifference <= 3.5310) //zoom 7_x000D_
zoomvalue='7';_x000D_
else if(maxdifference > 3.5310 && maxdifference <= 7.3367) //zoom 6_x000D_
zoomvalue='6';_x000D_
else if(maxdifference > 7.3367 && maxdifference <= 14.222) //zoom 5_x000D_
zoomvalue='5';_x000D_
else if(maxdifference > 14.222 && maxdifference <= 28.000) //zoom 4_x000D_
zoomvalue='4';_x000D_
else if(maxdifference > 28.000 && maxdifference <= 58.000) //zoom 3_x000D_
zoomvalue='3';_x000D_
else_x000D_
zoomvalue='1';_x000D_
return latitudeMid+'|'+longitudeMid+'|'+zoomvalue;_x000D_
}
_x000D_