<script type="text/javascript" src="../js/main.js"></script>
var searchData = '';
function searchByAjax(text, callResponse)//callback for 3rd party ajax requests { $.ajax({ url: searchUrl + text + searchUrlEnd, type: 'GET', dataType: 'json', success: function(searchData){ searchCoord.addData(searchData); lat = searchData.features[0].properties.lat; lon = searchData.features[0].properties.lon; map.setView(new L.LatLng(lat, lon), 12); } });};
var searchCoord = new L.GeoJSON(searchData, { onEachFeature: function (feature, layer) { var popupContent = ""; if (feature.properties && feature.properties.uwi) { popupContent = "<strong>UWI:</strong>" + " " + feature.properties.uwi + "<br/>" + "<strong>OPERATOR:</strong>" + " " + feature.properties.oper_abbre + "<br/>" + "<br/>"; } layer.bindPopup(popupContent + '<a href="report/report.html" target="_blank"><i class="fa fa-info-circle fa-2x"></i></a>'); }}).addTo(map);
map.addControl( new L.Control.Search({callData: searchByAjax, text:'UWI...', markerLocation: true}) );
<!DOCTYPE html><html> <header> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>Well Report</title> <script src="../js/vendor/jquery-2.1.1.min.js"></script> <script type="text/javascript" src="../js/main.js"></script> <link rel="stylesheet" href="report.css"> </header>
<body>
<!--How to get 'SearchCoord' Geojson data into this HTML page?-->
</body>
</html>
Ente<!DOCTYPE html><!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]--><!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]--><!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]--><!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]--> <head>
<meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Leaflet GIS App</title> <meta name="description" content=""> <meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Place favicon.ico and apple-touch-icon.png in the root directory -->
<link rel="stylesheet" href="css/normalize.css"> <link rel="stylesheet" href="css/main.css"> <script src="js/vendor/modernizr-2.6.2.min.js"></script> <link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css" /> <script src="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.js"></script> <script src="http://maps.google.com/maps/api/js?v=3.2&sensor=false"></script> <script src="js/vendor/leaflet/leaflet-google.js"></script> <script src="js/vendor/jquery-2.1.1.min.js"></script> <script src="js/vendor/leaflet/src/l.control.geosearch.js"></script> <script src="js/vendor/leaflet/src/l.geosearch.provider.esri.js"></script> <link rel="stylesheet" href="css/l.geosearch.css" /> <link rel="stylesheet" href="font-awesome-4.1.0/css/font-awesome.min.css"> <link rel="stylesheet" href="js/vendor/leaflet/dist/leaflet-search.min.css" />
</head> <body> <!--[if lt IE 7]> <p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p> <![endif]-->
<!-- Add your site or application content here --> <div id="map"> </div> <script src="js/vendor/leaflet/dist/leaflet-search.src.js"></script> <script src="js/vendor/leaflet/dist/leaflet-search.min.js"></script> <script src="js/plugins.js"></script> <script src="js/main.js"></script>
</body></html>r code here...
"<a href=\"report/report.html?ID=\"" + feature.properties.uniqueid + " target=\"_blank\">"