Hi,
I am new to osm and i am using mapquest open js sdk, i have done the custom map search using map.nominatimSearchAndAddLocation now i wanted to show the nearest places like hospitals,schools,hotels...etc around the placelike in mapquest . How do i do this? please help me out.
for reference i used this code
<html>
<head>
<script src="http://open.mapquestapi.com/sdk/js/v6.1.0/mqa.toolkit.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
window.map = new MQA.TileMap( /*constructs an instance of MQA.TileMap*/
document.getElementById('map'), /*ID of element on the page where you want the map added*/
3, /*intial zoom level of the map*/
{lat:12.976418, lng:77.6158}, /*center of map in latitude/longitude */
'map'); /*map type (map)*/
// for zooming control
MQA.withModule('carouselcontrol','shapes','georssdeserializer','remotecollection','smallzoom', function() {
map.addControl(
new MQA.SmallZoom(),
new MQA.MapCornerPlacement(MQA.MapCorner.TOP_LEFT, new MQA.Size(5,5))
);
});
});
function search_phase() {
var from = document.getElementById('fromLoc').value;//alert(from);
MQA.withModule('nominatim', function() {
/*Executes a Nominatim search and adds result to the map*/
map.nominatimSearchAndAddLocation(from, null);
});
}
</script>
</head>
<body>
<form id="getPOI">
<input type="text" id="fromLoc" name="fromLoc" value="">
<input type="button" value="Search in Map" onClick="search_phase();">
</form>
<div id='map' style='width:950px; height:625px;'></div>
</body>
</html>
asked
01 Jun '12, 09:27
Raj
21●3●3●6
accept rate:
0%