Skip to content

Commit

Permalink
new pin styles
Browse files Browse the repository at this point in the history
  • Loading branch information
christikaes committed May 26, 2017
1 parent eb2c843 commit 1145b9d
Show file tree
Hide file tree
Showing 6 changed files with 224 additions and 22 deletions.
10 changes: 4 additions & 6 deletions src/app/actions/spotsAdd.actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,10 @@ export class SpotsAddActions {
numspots: spot.numspots
});

for (let i = 0; i < spot.numspots; i++) {
this.ngRedux.dispatch({
type: SpotsAddActions.ADD,
payload: spotFeature
});
}
this.ngRedux.dispatch({
type: SpotsAddActions.ADD,
payload: spotFeature
});

this.addSpotsService.addSpot(spotFeature);
}
Expand Down
9 changes: 8 additions & 1 deletion src/app/components/map/mapgl/mapgl.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,14 @@ export class MapGLComponent implements OnInit, OnChanges {
this.zoomChange.emit(this.map.getZoom());
});

this.map.on('click', 'unclustered-points', function (e) {
this.map.on('click', 'unclustered-points-v2', function (e) {
new mapboxgl.Popup({offset: 25})
.setLngLat(e.features[0].geometry.coordinates)
.setHTML(`<a class="cta" href="http://maps.google.com/maps?daddr=${e.features[0].geometry.coordinates[1]},${e.features[0].geometry.coordinates[0]}" target="_blank">Navigate</a>`)
.addTo(this.map);
}.bind(this));

this.map.on('click', 'unclustered-points-v3', function (e) {
new mapboxgl.Popup({offset: 25})
.setLngLat(e.features[0].geometry.coordinates)
.setHTML(`<a class="cta" href="http://maps.google.com/maps?daddr=${e.features[0].geometry.coordinates[1]},${e.features[0].geometry.coordinates[0]}" target="_blank">Navigate</a>`)
Expand Down
27 changes: 15 additions & 12 deletions src/app/components/map/mapgl/style_parkabler.json
Original file line number Diff line number Diff line change
Expand Up @@ -3984,47 +3984,50 @@
}
},
{
"id": "unclustered-points",
"id": "unclustered-points-v2",
"type": "symbol",
"source": "spots",
"filter": ["!has", "point_count"],
"layout": {
"icon-image": "pin",
"icon-image": "pin-v2",
"icon-size": 1,
"icon-offset": [0, -12],
"icon-allow-overlap": true,
"text-field": "{numspots}",
"text-font": [
"DIN Offc Pro Medium",
"Arial Unicode MS Bold"
],
"text-size": 16,
"text-offset": [0, -1],
"text-size": 20,
"text-offset": [-0.3, -0.6],
"text-anchor": "center",
"text-allow-overlap": true
"text-allow-overlap": true,
"visibility": "none"
},
"paint": {
"text-color": "#ffffff"
}
},
{
"id": "unclustered-points-count",
"id": "unclustered-points-v3",
"type": "symbol",
"source": "spots",
"filter": ["!has", "point_count"],
"layout": {
"icon-image": "circle-15",
"icon-size": 2,
"icon-offset": [5, -15],
"icon-image": "pin-v3",
"icon-size": 1,
"icon-offset": [0, -12],
"icon-allow-overlap": true,
"text-field": "{numspots}",
"text-font": [
"DIN Offc Pro Medium",
"Arial Unicode MS Bold"
],
"text-field": "{numspots}",
"text-size": 16,
"text-offset": [0.6, -1.9],
"text-offset": [0.6, -1.7],
"text-anchor": "center",
"text-allow-overlap": true
"text-allow-overlap": true,
"visibility": "visible"
},
"paint": {
"text-color": "#ffffff"
Expand Down
97 changes: 97 additions & 0 deletions src/assets/img/pin-v2.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
97 changes: 97 additions & 0 deletions src/assets/img/pin-v3.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions src/assets/img/pin.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 1145b9d

Please sign in to comment.