0

I have created a web page in angular which is using TomTom map API. I want to use my own search bar to search locations in the map instead of using the built-in search bar of tomtom map. How can I do this?

Monsters
  • 63
  • 2
  • 7

1 Answers1

0

You can check very basic implementation done at: https://github.com/tomtom-international/geofences-creator

html:

<input type="text" id="search-text" class="form__input" value="San Francisco Airport">

js:

var query = document.getElementById("search-text").value;
fuzzySearch(query)
  .then(getAdditionalData)
  .then(processAdditionalDataResponse);

function fuzzySearch(query) {
  return tomtom
    .fuzzySearch()
    .query(query)
    .go()
    .then(function(result) {
      return result;
    });
}

There is also a tutorial that covers an application that have builtin search box adjusted. You can also check it: https://developer.tomtom.com/maps-sdk-web/tutorials-use-cases/pizza-delivery

szogoon
  • 470
  • 3
  • 15