diff --git a/designs/icons-tcef.svg b/designs/icons-tcef.svg index 1695da9..8f82ffd 100644 --- a/designs/icons-tcef.svg +++ b/designs/icons-tcef.svg @@ -245,14 +245,14 @@ borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" - inkscape:zoom="0.24748737" - inkscape:cx="-594.08486" - inkscape:cy="654.87036" + inkscape:zoom="0.25" + inkscape:cx="-324.9908" + inkscape:cy="1157.3585" inkscape:document-units="mm" inkscape:current-layer="layer1" showgrid="false" inkscape:window-width="1920" - inkscape:window-height="983" + inkscape:window-height="1016" inkscape:window-x="0" inkscape:window-y="867" inkscape:window-maximized="1" /> @@ -264,7 +264,7 @@ image/svg+xml - + @@ -481,5 +481,21 @@ style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:9.36170292;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - + diff --git a/imports/ui/components/Maps/Icons.js b/imports/ui/components/Maps/Icons.js index 47f5e29..7d8dc1f 100644 --- a/imports/ui/components/Maps/Icons.js +++ b/imports/ui/components/Maps/Icons.js @@ -16,18 +16,16 @@ export const nFireIcon = new Leaflet.Icon({ iconUrl: '/n-fire-marker.png', iconSize: [16, 24], // size of the icon iconAnchor: [8, 26] // point of the icon which will correspond to marker's location - /* shadowUrl: require('../public/marker-shadow.png'), */ - /* shadowSize: [50, 64], // size of the shadow */ - /* shadowAnchor: [4, 62], // the same for the shadow - * popupAnchor: [-3, -76]// point from which the popup should open relative to the iconAnchor */ }); export const positionIcon = new Leaflet.Icon({ iconUrl: '/your-position.png', iconSize: [50, 77], // size of the icon iconAnchor: [25, 82] // point of the icon which will correspond to marker's location - /* shadowSize: [50, 64], // size of the shadow */ - /* shadowUrl: require('../public/marker-shadow.png'), */ - /* shadowAnchor: [4, 62], // the same for the shadow - * popupAnchor: [-3, -76]// point from which the popup should open relative to the iconAnchor */ +}); + +export const removeIcon = new Leaflet.Icon({ + iconUrl: '/remove-marker.png', + iconSize: [24, 24], // size of the icon + iconAnchor: [12, 12] // point of the icon which will correspond to marker's location }); diff --git a/imports/ui/components/SelectionMap/SelectionMap.js b/imports/ui/components/SelectionMap/SelectionMap.js index 3616aaa..940bd83 100644 --- a/imports/ui/components/SelectionMap/SelectionMap.js +++ b/imports/ui/components/SelectionMap/SelectionMap.js @@ -12,7 +12,7 @@ import { translate } from 'react-i18next'; import { withTracker } from 'meteor/react-meteor-data'; import update from 'immutability-helper'; import geolocation from '/imports/startup/client/geolocation'; -import { positionIcon } from '/imports/ui/components/Maps/Icons'; +import { positionIcon, removeIcon } from '/imports/ui/components/Maps/Icons'; import DefMapLayers from '/imports/ui/components/Maps/DefMapLayers'; import 'leaflet-graphicscale/dist/Leaflet.GraphicScale.min.css'; import 'leaflet-graphicscale/dist/Leaflet.GraphicScale.min.js'; @@ -151,6 +151,7 @@ class SelectionMap extends Component { } render() { + const { t, onRemove } = this.props; return (
{ this.isValidState() && @@ -169,10 +170,22 @@ class SelectionMap extends Component { onViewportChanged={this.onViewportChanged} sleepNote hoverToWake - wakeMessage={this.props.t('Pulsa para activar')} + wakeMessage={t('Pulsa para activar')} sleepOpacity={0.6} > + {this.props.action === action.edit && + this.props.currentSubs.map(subs => ( + { onRemove(subs._id); }} + /> + )) + } {this.props.action === action.add && { this.marker = ref; }} /> this.onViewportChanged(viewport)} loadingSubs={this.props.loading} currentSubs={this.props.subscriptions} + onRemove={(id) => { this.handleRemove(id); }} /> - {subscriptions.length ? - - - - - - - - - - {subscriptions.map(({ - _id, - location, - createdAt, - updatedAt - }) => ( - - - - - - - - ))} - -
LugarActualizadoCreado - - -
{location.lat},{location.lon}{timeago(updatedAt)}{timeago(createdAt)} - - - -
: - No estás suscrito a fuegos en ninguna zona + { subscriptions.length === 0 && + No estás suscrito a fuegos en ninguna zona }
) : ); diff --git a/public/remove-marker.png b/public/remove-marker.png new file mode 100644 index 0000000..fda9ecd Binary files /dev/null and b/public/remove-marker.png differ