Search panel - hslayers/hslayers-ng GitHub Wiki

Search results

The search panel is designed to help the user find the location of a place quickly and easily. Each found location is marked on the map with a point feature.

Search panel

Config parameters

List of useful config parameters for the search panel can be found here:

searchProvider

geonamesUser

Enable/disable

import {HsConfig} from 'hslayers-ng/config';
@Component({
  selector: 'your-app-component',
  templateUrl: 'your-app-component.html',
})
export class YourAppComponent {
  constructor(hsConfig: HsConfig) {
    this.HsConfig.update({
      panelsEnabled: {
        search: true //(false by default)
      }
    });
  }
}

If not using HslayersModule containing all components

Add HsSearchModule import:

import {HsSearchModule} from 'hslayers-ng/components/search';
@NgModule({
  imports: [HsSearchModule],
})
export class YourAppModule {}

Add HsSearchComponent component:

import {HsSearchModule} from 'hslayers-ng/components/search';
import {HsLayoutService } from 'hslayers-ng/core';

@Component({
  selector: 'your-app-component',
  templateUrl: 'your-app-component.html',
})
export class YourAppComponent {
  constructor(hsLayoutService: HsLayoutService) {
    hsLayoutService.createPanel(HsSearchComponent, {});
  }
}