Files
2026-05-24 13:49:25 +07:00

6 lines
2.6 KiB
Plaintext

google.maps.__gjsload__('search', function(_){var Gza=function(a){var b=[];a.data.forEach(c=>{b.push(...Fza(c))});return b},Fza=function(a){var b=_.mp,c=-1;a.tiles.forEach(e=>{e.zoom>c&&(b=e.kj,c=e.zoom)});if(c===-1)return[];var d=[];a.mw().forEach(e=>{e.a&&e.a.length>=2&&d.push(new Hza(e,b,c))});return d},Iza=class extends _.ho{};var Jza={["1"]:{}},Hza=class{constructor(a,b,c){this.Jo=b;this.zoom=c;this.bounds=this.anchor=null;this.mh=Jza;this.source=a;this.featureId=this.source.id||"0";this.infoWindowOffset=(this.source.io||[]).length===2?new google.maps.Point(this.source.io[0],this.source.io[1]):null}getAnchor(){if(!this.anchor){let a=1<<this.zoom;this.anchor=_.Ir(new _.Pq((this.Jo.x*256+this.source.a[0])/a,(this.Jo.y*256+this.source.a[1])/a)).toJSON()}return this.anchor}getCompleteBounds(){return this.getBounds().reduce((a,
b)=>{a.extendByBounds(b);return a},_.wp(0,0,0,0))}getBounds(){if(this.bounds===null){this.bounds=[];let a=this.source.bb||[];if(a.length%4===0)for(let b=0;b<a.length;b+=4){let c=this.bounds[this.bounds.length-1],d=_.wp(a[b],a[b+1],a[b+2],a[b+3]);c&&c.equals(d)||this.bounds.push(d)}}return[...this.bounds]}getExtendedContent(a){if(this.mh===Jza)try{this.mh=this.source.c?JSON.parse(this.source.c):{}}catch(b){this.mh={}}return this.mh[a]??{}}getFeatureName(){return this.getExtendedContent("1")?.title??
null}isTransitStation(){return this.getExtendedContent("1")?.is_transit_station??!1}};var Kza=new WeakSet,LH=class extends Iza{constructor(a){super();this.setValues(a);this.setOptions=b=>{this.setValues(b)};_.am("search_impl")}changed(){var a=this,b=this.get("map"),c=null;b&&(c=b.__gm,b=Number(c.get("blockingLayerCount"))||0,c.set("blockingLayerCount",b+1),c.set("disableLabelingHysteresis",this.get("disableLabelingHysteresis")),c.set("tilePrefetchEnabled",this.get("tilePrefetchEnabled")));_.am("search_impl").then(d=>{d.mh(a);c&&(d=Number(c.get("blockingLayerCount"))||0,c.set("blockingLayerCount",
d-1))})}static enableFeatureMapEventsRasterOnly(a){if(_.Eq[15]){var b=a.__gm.Kh;if(!Kza.has(a)){Kza.add(a);var c=[],d=(f,g)=>{f=Fza(f);f.length&&_.co(a,g,f)},e=()=>{for(;c.length>0;)c.pop().remove();b.forEach(f=>{if(f=f.data)c.push(_.On(f,"insert",g=>{d(g,"addfeatures")})),c.push(_.On(f,"remove",g=>{d(g,"removefeatures")}))})};b.addListener("insert_at",e);b.addListener("remove_at",e);b.addListener("set_at",e);e()}(()=>{var f=[];b.forEach(g=>{f.push(...Gza(g))});f.length&&_.co(a,"addfeatures",f)})()}}};
LH.enableFeatureMapEventsRasterOnly=LH.enableFeatureMapEventsRasterOnly;_.Jo(LH.prototype,{map:_.ft});_.ya.google.maps.search={GoogleLayer:LH};_.bm("search",{});});