Commit cb64c860ec882ade05c19815fb3be4f5a82de256

Authored by Vladyslav_Prykhodko
1 parent 968f2745

Update tootlip create marker/polygon

... ... @@ -127,10 +127,14 @@ export default abstract class LeafletMap {
127 127 const newMarker = L.marker(mousePositionOnMap, { icon }).addTo(this.map);
128 128 const datasourcesList = document.createElement('div');
129 129 const customLatLng = this.convertToCustomFormat(mousePositionOnMap);
  130 + const header = document.createElement('p');
  131 + header.appendChild(document.createTextNode('Select entity:'));
  132 + header.setAttribute('style', 'font-size: 14px; margin: 8px 0');
  133 + datasourcesList.append(header);
130 134 this.datasources.forEach(ds => {
131 135 const dsItem = document.createElement('p');
132 136 dsItem.appendChild(document.createTextNode(ds.entityName));
133   - dsItem.setAttribute('style', 'font-size: 14px');
  137 + dsItem.setAttribute('style', 'font-size: 14px; margin: 8px 0; cursor: pointer');
134 138 dsItem.onclick = () => {
135 139 const updatedEnttity = { ...ds, ...customLatLng };
136 140 this.saveMarkerLocation(updatedEnttity).subscribe(() => {
... ... @@ -141,9 +145,9 @@ export default abstract class LeafletMap {
141 145 }
142 146 datasourcesList.append(dsItem);
143 147 });
  148 + datasourcesList.append(document.createElement('br'));
144 149 const deleteBtn = document.createElement('a');
145   - deleteBtn.appendChild(document.createTextNode('Delete position'));
146   - deleteBtn.setAttribute('color', 'red');
  150 + deleteBtn.appendChild(document.createTextNode('Discard changes'));
147 151 deleteBtn.onclick = () => {
148 152 this.map.removeLayer(newMarker);
149 153 }
... ... @@ -196,10 +200,14 @@ export default abstract class LeafletMap {
196 200 const newPolygon = L.polygon(mousePositionOnMap).addTo(this.map);
197 201 const datasourcesList = document.createElement('div');
198 202 const customLatLng = {[this.options.polygonKeyName]: this.convertToPolygonFormat(mousePositionOnMap)};
  203 + const header = document.createElement('p');
  204 + header.appendChild(document.createTextNode('Select entity:'));
  205 + header.setAttribute('style', 'font-size: 14px; margin: 8px 0');
  206 + datasourcesList.append(header);
199 207 this.datasources.forEach(ds => {
200 208 const dsItem = document.createElement('p');
201 209 dsItem.appendChild(document.createTextNode(ds.entityName));
202   - dsItem.setAttribute('style', 'font-size: 14px');
  210 + dsItem.setAttribute('style', 'font-size: 14px; margin: 8px 0; cursor: pointer');
203 211 dsItem.onclick = () => {
204 212 const updatedEnttity = { ...ds, ...customLatLng };
205 213 this.savePolygonLocation(updatedEnttity).subscribe(() => {
... ... @@ -209,9 +217,9 @@ export default abstract class LeafletMap {
209 217 }
210 218 datasourcesList.append(dsItem);
211 219 });
  220 + datasourcesList.append(document.createElement('br'));
212 221 const deleteBtn = document.createElement('a');
213   - deleteBtn.appendChild(document.createTextNode('Delete position'));
214   - deleteBtn.setAttribute('color', 'red');
  222 + deleteBtn.appendChild(document.createTextNode('Discard changes'));
215 223 deleteBtn.onclick = () => {
216 224 this.map.removeLayer(newPolygon);
217 225 }
... ...