我在我的应用程序中使用了google map
。
我希望每当用户选择区域并单击此处的缩放选项时,SidePane
它应该隐藏该区域,地图应该widen
。
请参阅Zoom here Jquery code
以及侧窗格切换。任何帮助将不胜感激。
J.selectedStore_changed = function () {
$(".highlighted", this.b).removeClass("highlighted");
var a = this, b = this.get("selectedStore");
if (b) {
this.m = b;
this.b[r]("#store-" + b[D]())[x]("highlighted");
this.c.directions && this.a[r](".directions-to").val(b.getDetails().title);
var c = a.get("view").getInfoWindow().getContent(), e = $("<a/>").text("Directions")[p]("href", "#")[x]("action")[x]("directions"), i = $("<a/>").text("Zoom here")[p]("href", "#")[x]("action")[x]("zoomhere"), k = $("<a/>").text("")[p]("href", "#")[x]("action")[x]("streetview");
e[z](function () {
if ($('#panel').is(":visible") == false) {
$('#panel').animate({
width: 'toggle'
});
setTimeout(function () {
google.maps.event.trigger(document.getElementById('map-canvas'), "resize");
}, 250);
}
a.showDirections();
return g;
}
);
i[z](function () { a.get("view")[u]().setOptions({ center: b[j](), zoom: 16 }) }); k[z](function () { var c = a.get("view")[u]().getStreetView(); c.setPosition(b[j]()); c.setVisible(d) }); $(c)[G](e)[G](i)[G](k);
}
};
J.hideDirections = function () { this.h = g; this.a.fadeOut(); this.d.fadeIn(); this.b.fadeIn(); this.l[F](f) };
J.showDirections = function () { var a = this.get("selectedStore"); this.d.fadeOut(); this.b.fadeOut(); this.a[r](".directions-to").val(a.getDetails().title); this.a.fadeIn(); S(this); this.h = d }; function S(a) { if (a.k && a.m) { var b = a.a[r](".rendered-directions").empty(); a.t.route({ origin: a.k, destination: a.m[j](), travelMode: google[t].DirectionsTravelMode.DRIVING }, function (c, e) { if (e == google[t].DirectionsStatus.OK) { var i = a.l; i.setPanel(b[0]); i[F](a.get("view")[u]()); i.setDirections(c) } }) } } J.featureFilter_changed = function () { T(this) }; function V() { this.b = [] } K.StaticDataFeed = V; V[C].setStores = function (a) { this.b = a; this.a ? this.a() : delete this.a }; V[C].getStores = function (a, b, c) { if (this.b[B]) { for (var e = [], i = 0, k; k = this.b[i]; i++) k.hasAllFeatures(b) && e[w](k); aa(a.getCenter(), e); c(e) } else { var y = this; this.a = function () { y.getStores(a, b, c) } } }; function aa(a, b) { b.sort(function (b, e) { return b.distanceTo(a) - e.distanceTo(a) }) };