﻿var mapObj; var imageBaseUrl = "http://pic.dq3c.cn/images/map/point/"; function mapInit(g, a, e, b) { var c = new MMapOptions(); c.zoom = 12; c.returnCoordType = COORD_TYPE_OFFSET; var d; if (e != "") { var f = e.split(","); d = new MLngLat(f[0], f[1]) } else { d = getLngLat(a) } if (typeof (b) == "undefined") { b = true } c.center = d; c.toolbar = DEFAULT; c.toolbarPos = new MPoint(0, 0); if (b) { c.overviewMap = DEFAULT } mapObj = new MMap(g, c) } function getLngLat() { var b = arguments[0]; var d = getCityXY(b); var c = new MLngLat(d[0], d[1]); return c } function getCityXY(a) { var b = new Array(); b = city.ctxy(a); if (typeof (b) == "undefined") { b = city.ctxy("010") } return b } function drawPoints(v, s) { mapObj.removeAllOverlays(); var o = new Array(); var f; var r = ""; var e; if (typeof (s) == "undefined" || s == null) { s = true } for (var q = 0; q < v.poilist.length; q++) { var j = v.poilist[q].x; var g = v.poilist[q].y; var u = v.poilist[q].id; var c = v.poilist[q].serial; var h = new MMarkerOptions(); h.isDraggable = false; h.canShowTip = s; h.imageUrl = imageBaseUrl + "m" + c + "a.gif"; var b = v.poilist[q].address; var d = v.poilist[q].tel; var p = ""; p += "地址:" + b + "<br/>"; p += "电话:" + d + "<br/>"; var l = new MTipOptions(); l.title = v.poilist[q].name; l.content = p; l.hasShadow = true; l.tipType = HTMLBUBBLETIP; var n = new MFillStyle(); n.color = 16777215; n.alpha = 1; l.titleFillStyle = n; var m = new MFontStyle(); m.size = 14; l.titleFontStyle = m; var a = new MFontStyle(); a.size = 13; l.contentFontStyle = a; var t = new MLineStyle(); t.thickness = 1; t.color = 6646675; t.alpha = 1; l.borderStyle = t; h.tipOption = l; var k = new MLngLat(j, g); e = new MMarker(k, h); e.id = u; o.push(e) } mapObj.addOverlays(o, true) } function displayTip(a) { mapObj.openOverlayTip(a) } function closeTip() { if (typeof (mapObj) != "undefined") { mapObj.closeTip() } } function updateIcon(c) { var a = mapObj.getOverlayById(c.overlayId); var b = a.option.imageUrl; if (b.indexOf("a.gif") >= 0) { a.option.imageUrl = b.replace("a.gif", "b.gif") } else { a.option.imageUrl = b.replace("b.gif", "a.gif") } mapObj.updateOverlay(a) } function updateIcon2(c) { var a = mapObj.getOverlayById(c); var b = a.option.imageUrl; if (b.indexOf("a.gif") >= 0) { a.option.imageUrl = b.replace("a.gif", "b.gif") } else { a.option.imageUrl = b.replace("b.gif", "a.gif") } mapObj.updateOverlay(a) };