PageSourceSearch

https://www.openstreetmap.org/assets/index_modules/search-7f5e1d1e…3e189496206e2545edafdb73fc2494264bf46afd.js

js openstreetmap.org collected 2026-09-24 06:40:49 UTC 1,912 bytes, 1 lines download raw bytes

1export default function(t){function e(t){t.preventDefault(),t.stopPropagation();const e=$(this).parents(".search_more");$(this).hide(),e.find(".loader").prop("hidden",!1),n(this,e)}function n({href:t},e){return fetch(t,{method:"POST",body:new URLSearchParams(OSM.csrf)}).then(t=>t.text()).then(t=>{const n=$(t);e.replaceWith(n),n.filter("ul").children().each(a)})}function a(){const t=i++,e=$(this),n=`hwb(${t*(180*(Math.sqrt(5)-1))%360}deg 5% 5%)`;e.css("--marker-color",n);const a=e.find("a.set_position").data(),o=L.marker([a.lat,a.lon],{icon:OSM.getMarker({color:n,className:"activatable"})});o.on("mouseover",()=>e.addClass("bg-body-secondary")),o.on("mouseout",()=>e.removeClass("bg-body-secondary")),o.on("click",function(t){OSM.router.click(t.originalEvent,e.find("a.set_position").attr("href"))}),s.addLayer(o),e.on("mouseover",()=>$(o.getElement()).addClass("active")),e.on("mouseout",()=>$(o.getElement()).removeClass("active"))}function o(e){e.minLon&&e.minLat&&e.maxLon&&e.maxLat?t.fitBounds([[e.minLat,e.minLon],[e.maxLat,e.maxLon]]):t.setView([e.lat,e.lon],e.zoom)}function r(t){const e=$(this).data();o(e),e.type&&e.id||(t.preventDefault(),t.stopPropagation())}$("#sidebar_content").on("click",".search_more a",e).on("click",".search_results_entry a.set_position",r);const s=L.layerGroup().addTo(t);let i=0;const c={load:function(t){const e=new URLSearchParams(t.substring(t.indexOf("?")));e.has("query")?$(".search_form input[name=query]").val(e.get("query")):e.has("lat")&&e.has("lon")&&$(".search_form input[name=query]").val(e.get("lat")+", "+e.get("lon")),OSM.loadSidebarContent(t).then(c.init)},init:function(){return $(".search_results_entry[data-href]").each(function(t){const e=$(this);n(this.dataset,e.children().first()).then(()=>{if(0===t){const t=e.find("*[data-lat][data-lon]:first").first();t.length&&o(t.data())}})}),t.getState()},unload:function(){s.clearLayers(),i=0}};return c}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.