
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
@mapify/angular
Advanced tools
The @mapify/angular project contains the Mapify angular components which can be used to ease the visualisation of Mapify maps and data.
You can checkout the following blog post for an example on setting up an Angular App.
For further information and blog posts you can go here.
You will need to have nodejs and npm installed.
You will need a Mapify account in order to get an API Key to use when configuring the SDK and other components.
Install @mapify/angular from npm:
npm i @mapify/angular @angular/cdk@13 @angular/material@13 --savethen add to polyfills.ts:
import 'reflect-metadata';The Angular library requires:
In order to use the Angular components provided by this library, you will need to configure the module when importing it in your app's module.
In your app's module import MapifyAngularModule with the configuration required:
import { MapifyAngularModule } from '@mapify/angular'
import { MapConfig } from '@mapify/core';
@NgModule({
imports: [
MapifyAngularModule.forRoot(new MapConfig(
// Your API keys
environment.mapifyApiKey,
environment.googleMapsApiKey
))
]
...
})
export class YourAppModule { }
From this point onward, you will be able to use components provided in the library.
In you component's html add the mapify-map component:
<mapify-map [map]="map" #mapifymap> </mapify-map>
In your component initialize and use the MapifyClient in order to get your maps:
import { MapifyClient, Map } from '@mapify/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss'],
})
export class AppComponent implements OnInit {
@ViewChild('mapifymap') mapifyMap: MapifyMapComponent;
public map: Map;
constructor() {
const clientConfig: ClientConfig = {
// Your API key
apiKey: environment.mapifyApiKey,
};
this.mapifyClient = MapifyClient.createClient(clientConfig);
}
public async ngOnInit(): Promise<void> {
// Get some maps from Mapify
const maps = await this.mapifyClient.maps.getAllPaginated();
if (maps?.items?.length <= 0) {
return;
}
const desiredMap = maps.items[0];
// Request the map specifically to get the full data needed to display the map
this.map = await this.mapifyClient.maps.get(desiredMap.mapId);
}
}
By updating the contents of this.map the Mapify map component will detect changes and react to them. By using the ViewChild mapifyMap we can gain access to further methods that help us manipulate the map we have provided.
For example in order to show the map use:
this.mapifyMap.showMap();
Or to hide the map:
this.mapifyMap.hideMap();
Or to query the map's visibility:
this.mapifyMap.isMapVisible();
In order to center the map use:
this.mapifyMap.centerMap();
NOTE: In order to be able to manipulate the map, you will need to wait for the map to be set in the component. For example, you will not be able to toggle the map in the same
ngOnInitmethod in which you changed the content ofthis.map. This is because at that point no changes have been detected yet, thus only in the following cycles will the component render the map data provided.
In order to start the map with layers visible/centered there are two approaches you can choose from:
onMapReady
The first approach is to send a handler to the mapReady event emitter, that toggles the map visibility and centers the map once the map is ready.
Example usage:
export class AppComponent implements OnInit {
...
// Define the method in your component
public onMapReady() {
this.mapifyMap.showMap();
this.mapifyMap.centerMap();
}
}
<mapify-map [map]="map" (mapReady)="onMapReady()" #mapifymap> </mapify-map>
The mapify-map component can be further configured. Optional inputs include:
The googleMapsMapOptions gives control of the base map and its properties. For more information on this interface check Google's documentation here.
The height property allows the height of the map container to be defined. By default it is set to '100%'. This string should reflect a CSS string's format to apply to the map's container's height style.
The width property allows the width of the map container to be defined. By default it is set to '100%'. This string should reflect a CSS string's format to apply to the map's container's width style.
In you component's html add the mapify-map component:
<mapify-map
#mapifymap
[map]="map"
[googleMapsMapOptions]="googleMapsMapOptions"
height="height"
width="width"
(mapReady)="onMapReady()"
>
</mapify-map>
In your component initialize and use the configurations:
...
export class AppComponent implements OnInit {
@ViewChild('mapifymap') mapifyMap: MapifyMapComponent;
public map: Map;
public height: '500px';
public width: '500px';
public googleMapsMapOptions: google.maps.MapOptions = {
backgroundColor: '#2B2B2B',
zoomControl: false,
scrollwheel: true,
disableDoubleClickZoom: true,
fullscreenControl: false,
mapTypeControl: false,
streetViewControl: false,
maxZoom: 20,
minZoom: 1,
zoom: 3,
}
constructor() {}
...
}
FAQs
Mapify angular components library
The npm package @mapify/angular receives a total of 37 weekly downloads. As such, @mapify/angular popularity was classified as not popular.
We found that @mapify/angular demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.