Skip to content

Commit

Permalink
Fixes #2 - Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
HarelM committed Jun 24, 2021
1 parent 260c005 commit a9a91be
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { Map, SymbolLayer } from 'maplibre-gl';
>
<mgl-layer
id="3d-buildings"
source="composite"
source="openmaptiles"
sourceLayer="building"
[filter]="['==', 'extrude', 'true']"
type="fill-extrusion"
Expand Down
20 changes: 10 additions & 10 deletions projects/showcase/src/app/demo/examples/popup-on-click.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { MapboxGeoJSONFeature, MapLayerMouseEvent } from 'maplibre-gl';
source="points"
type="symbol"
[layout]="{
'icon-image': '{icon}-15',
'icon-image': ['get', 'icon'],
'icon-allow-overlap': true
}"
(layerClick)="onClick($event)"
Expand Down Expand Up @@ -47,7 +47,7 @@ export class PopupOnClickComponent {
// tslint:disable-next-line:max-line-length
description:
'<strong>Make it Mount Pleasant</strong><p><a href="http://www.mtpleasantdc.com/makeitmtpleasant" target="_blank" title="Opens in a new window">Make it Mount Pleasant</a> is a handmade and vintage market and afternoon of live entertainment and kids activities. 12:00-6:00 p.m.</p>',
icon: 'theatre',
icon: 'theatre_15',
},
geometry: {
type: 'Point',
Expand All @@ -60,7 +60,7 @@ export class PopupOnClickComponent {
// tslint:disable-next-line:max-line-length
description:
'<strong>Mad Men Season Five Finale Watch Party</strong><p>Head to Lounge 201 (201 Massachusetts Avenue NE) Sunday for a <a href="http://madmens5finale.eventbrite.com/" target="_blank" title="Opens in a new window">Mad Men Season Five Finale Watch Party</a>, complete with 60s costume contest, Mad Men trivia, and retro food and drink. 8:00-11:00 p.m. $10 general admission, $20 admission and two hour open bar.</p>',
icon: 'theatre',
icon: 'theatre_15',
},
geometry: {
type: 'Point',
Expand All @@ -73,7 +73,7 @@ export class PopupOnClickComponent {
// tslint:disable-next-line:max-line-length
description:
'<strong>Big Backyard Beach Bash and Wine Fest</strong><p>EatBar (2761 Washington Boulevard Arlington VA) is throwing a <a href="http://tallulaeatbar.ticketleap.com/2012beachblanket/" target="_blank" title="Opens in a new window">Big Backyard Beach Bash and Wine Fest</a> on Saturday, serving up conch fritters, fish tacos and crab sliders, and Red Apron hot dogs. 12:00-3:00 p.m. $25.grill hot dogs.</p>',
icon: 'bar',
icon: 'bar_15',
},
geometry: {
type: 'Point',
Expand All @@ -86,7 +86,7 @@ export class PopupOnClickComponent {
// tslint:disable-next-line:max-line-length
description:
'<strong>Ballston Arts & Crafts Market</strong><p>The <a href="http://ballstonarts-craftsmarket.blogspot.com/" target="_blank" title="Opens in a new window">Ballston Arts & Crafts Market</a> sets up shop next to the Ballston metro this Saturday for the first of five dates this summer. Nearly 35 artists and crafters will be on hand selling their wares. 10:00-4:00 p.m.</p>',
icon: 'art-gallery',
icon: 'art_gallery_15',
},
geometry: {
type: 'Point',
Expand All @@ -99,7 +99,7 @@ export class PopupOnClickComponent {
// tslint:disable-next-line:max-line-length
description:
'<strong>Seersucker Bike Ride and Social</strong><p>Feeling dandy? Get fancy, grab your bike, and take part in this year\'s <a href="http://dandiesandquaintrelles.com/2012/04/the-seersucker-social-is-set-for-june-9th-save-the-date-and-start-planning-your-look/" target="_blank" title="Opens in a new window">Seersucker Social</a> bike ride from Dandies and Quaintrelles. After the ride enjoy a lawn party at Hillwood with jazz, cocktails, paper hat-making, and more. 11:00-7:00 p.m.</p>',
icon: 'bicycle',
icon: 'bicycle_15',
},
geometry: {
type: 'Point',
Expand All @@ -112,7 +112,7 @@ export class PopupOnClickComponent {
// tslint:disable-next-line:max-line-length
description:
'<strong>Capital Pride Parade</strong><p>The annual <a href="http://www.capitalpride.org/parade" target="_blank" title="Opens in a new window">Capital Pride Parade</a> makes its way through Dupont this Saturday. 4:30 p.m. Free.</p>',
icon: 'star',
icon: 'star_15',
},
geometry: {
type: 'Point',
Expand All @@ -125,7 +125,7 @@ export class PopupOnClickComponent {
// tslint:disable-next-line:max-line-length
description:
'<strong>Muhsinah</strong><p>Jazz-influenced hip hop artist <a href="http://www.muhsinah.com" target="_blank" title="Opens in a new window">Muhsinah</a> plays the <a href="http://www.blackcatdc.com">Black Cat</a> (1811 14th Street NW) tonight with <a href="http://www.exitclov.com" target="_blank" title="Opens in a new window">Exit Clov</a> and <a href="http://godsilla.bandcamp.com" target="_blank" title="Opens in a new window">Gods’illa</a>. 9:00 p.m. $12.</p>',
icon: 'music',
icon: 'music_15',
},
geometry: {
type: 'Point',
Expand All @@ -138,7 +138,7 @@ export class PopupOnClickComponent {
// tslint:disable-next-line:max-line-length
description:
'<strong>A Little Night Music</strong><p>The Arlington Players\' production of Stephen Sondheim\'s <a href="http://www.thearlingtonplayers.org/drupal-6.20/node/4661/show" target="_blank" title="Opens in a new window"><em>A Little Night Music</em></a> comes to the Kogod Cradle at The Mead Center for American Theater (1101 6th Street SW) this weekend and next. 8:00 p.m.</p>',
icon: 'music',
icon: 'music_15',
},
geometry: {
type: 'Point',
Expand All @@ -151,7 +151,7 @@ export class PopupOnClickComponent {
// tslint:disable-next-line:max-line-length
description:
'<strong>Truckeroo</strong><p><a href="http://www.truckeroodc.com/www/" target="_blank">Truckeroo</a> brings dozens of food trucks, live music, and games to half and M Street SE (across from Navy Yard Metro Station) today from 11:00 a.m. to 11:00 p.m.</p>',
icon: 'music',
icon: 'music_15',
},
geometry: {
type: 'Point',
Expand Down
56 changes: 25 additions & 31 deletions projects/showcase/src/app/demo/examples/toggle-layers.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,70 +8,65 @@ import { AnyLayout } from 'maplibre-gl';
[style]="
'https://api.maptiler.com/maps/streets/style.json?key=get_your_own_OpIi9ZULNHzrESv6T2vL'
"
[zoom]="[15]"
[zoom]="[3]"
[center]="[-71.97722138410576, -13.517379300798098]"
>
<mgl-vector-source
id="museums"
url="https://api.maptiler.com/tiles/v3/tiles.json?key=get_your_own_OpIi9ZULNHzrESv6T2vL"
id="countries"
[tiles]="['https://demotiles.maplibre.org/tiles/{z}/{x}/{y}.pbf']"
>
</mgl-vector-source>
<mgl-vector-source
id="contours"
id="everything"
url="https://api.maptiler.com/tiles/v3/tiles.json?key=get_your_own_OpIi9ZULNHzrESv6T2vL"
>
</mgl-vector-source>
<mgl-layer
id="museums"
type="circle"
source="museums"
[layout]="layouts['museums']"
id="countries-layer"
type="line"
source="countries"
[layout]="layouts['countries']"
[paint]="{
'circle-radius': 8,
'circle-color': 'rgba(55,148,179,1)'
'line-color': 'blue'
}"
sourceLayer="museum-cusco"
sourceLayer="countries"
>
</mgl-layer>
<mgl-layer
id="contours"
type="line"
source="contours"
[layout]="layouts['contours']"
[paint]="{
'line-color': '#877b59',
'line-width': 1
}"
sourceLayer="contour"
id="names"
type="symbol"
source="everything"
[layout]="layouts['names']"
sourceLayer="place"
>
</mgl-layer>
</mgl-map>
<div class="menu">
<mat-button-toggle
[checked]="true"
value="contours"
value="names"
(change)="toggleLayer($event)"
>contours</mat-button-toggle
>countries names</mat-button-toggle
>
<mat-button-toggle
[checked]="true"
value="museums"
value="countries"
(change)="toggleLayer($event)"
>museums</mat-button-toggle
>countries border</mat-button-toggle
>
</div>
`,
styleUrls: ['./examples.css', './toggle-layers.component.css'],
})
export class ToggleLayersComponent implements OnInit {
layouts: { [key: string]: AnyLayout } = {
contours: {
visibility: 'visible',
'line-join': 'round',
'line-cap': 'round',
countries: {
visibility: 'none',
},
museums: {
visibility: 'visible',
names: {
visibility: 'none',
'text-field': '{name:latin}',
'text-size': 30,
},
};

Expand All @@ -83,6 +78,5 @@ export class ToggleLayersComponent implements OnInit {
visibility:
this.layouts[evt.value].visibility === 'visible' ? 'none' : 'visible',
};
// HM TODO: this needs a fix...
}
}

0 comments on commit a9a91be

Please sign in to comment.