NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

0
1

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's gravatar image

Raj
21336
accept rate: 0%

edited 01 Jun '12, 09:27

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×710
×689
×25

question asked: 01 Jun '12, 09:27

question was seen: 4,691 times

last updated: 01 Jun '12, 09:27

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum