내지도 중 하나에 Google지도를 추가하려고합니다. 내에서Google지도에 서버 측 위도/경도 값 추가 javascript
코드 숨김, 내가지도에 대한 중심점, 내가지도하고 싶습니다 위도/경도의 배열이 있습니다
protected void Page_Load(object sender, EventArgs e)
{
Point center = new Point { latitude = 28.42693F, longitude = -81.4673F };
List<Point> points = new List<Point>();
points.Add(new Point { latitude = 28.43039F, longitude = -81.47186F });
points.Add(new Point { latitude = 28.36906F, longitude = -81.56063F });
Point[] pointArray = points.ToArray();
}
public class Point
{
public float latitude;
public float longitude;
}
을 내 페이지를,이 자바 스크립트가 :
<script type="text/javascript">
function initialize() {
if (GBrowserIsCompatible()) {
var map = new GMap2(document.getElementById("map_canvas"));
map.setCenter(new GLatLng(28.42693, -81.4673), 13);
//map.setUIToDefault();
var blueIcon = new GIcon(G_DEFAULT_ICON);
blueIcon.image = "http://www.google.com/intl/en_us/mapfiles/ms/micons/blue-dot.png";
markerOptions = { icon: blueIcon };
var point = new GLatLng(28.43039, -81.47186);
map.addOverlay(new GMarker(point, markerOptions));
point = new GLatLng(28.36906, -81.56063);
map.addOverlay(new GMarker(point, markerOptions));
}
}
</script>
값은 테스트를 위해 현재 자바 스크립트에 하드 코딩되어 있습니다,하지만 난 코드 숨김에서 동적 값을 얻을 필요가있다. 어떻게해야합니까?