Skip to content

Commit

Permalink
Removing debug code
Browse files Browse the repository at this point in the history
  • Loading branch information
cheesegrits committed Mar 27, 2023
1 parent c18dc1e commit dccf65e
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 6 deletions.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/mix-manifest.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"/cheesegrits/filament-google-maps/filament-google-maps.js": "/cheesegrits/filament-google-maps/filament-google-maps.js?id=e735a0c2f18a8ecb78defc1f5fd5cf7b",
"/cheesegrits/filament-google-maps/filament-google-maps.js": "/cheesegrits/filament-google-maps/filament-google-maps.js?id=58c6fc1bd497cd8f6632c6cc6df9fa72",
"/cheesegrits/filament-google-maps/filament-google-geocomplete.js": "/cheesegrits/filament-google-maps/filament-google-geocomplete.js?id=5d52cfd69c0e21b001a597235937535a",
"/cheesegrits/filament-google-maps/filament-google-maps-widget.js": "/cheesegrits/filament-google-maps/filament-google-maps-widget.js?id=e376c9c6da02692bec1b65587e069cc2",
"/cheesegrits/filament-google-maps/filament-google-maps.css": "/cheesegrits/filament-google-maps/filament-google-maps.css?id=a68ba88f31be3de468ee58f07c4ee0ee"
Expand Down
27 changes: 23 additions & 4 deletions resources/js/filament-google-maps.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,10 @@ window.filamentGoogleMaps = ($wire, config) => {
overlays: [],
dataLayer: null,
polyOptions: {
strokeWeight: 0,
// strokeColor: '#f06eaa',
strokeColor: '#00ff00',
strokeOpacity: '0.5',
strokeWeight: 3,
fillOpacity: 0.45,
draggable: true,
editable: false,
Expand Down Expand Up @@ -277,9 +280,9 @@ window.filamentGoogleMaps = ($wire, config) => {
google.maps.event.addListener(this.drawingManager, 'drawingmode_changed', () => {
this.clearSelection()
});
google.maps.event.addListener(this.map, 'click', () => {
this.clearSelection()
});
// google.maps.event.addListener(this.map, 'click', () => {
// this.clearSelection()
// });

if (this.config.drawingField) {
this.dataLayer = new google.maps.Data();
Expand Down Expand Up @@ -635,6 +638,17 @@ window.filamentGoogleMaps = ($wire, config) => {
// selectColor(shape.get('fillColor') || shape.get('strokeColor'));
this.overlays.forEach(function (item) {
if (shape && item.id == shape.id) {
if (item.getEditable()) {
shape.setOptions({
strokeColor: '#00ff00',
strokeOpacity: '0.5'
});
} else {
shape.setOptions({
strokeColor: '#ff0000',
strokeOpacity: '0.8'
});
}
item.setEditable(!item.getEditable());
} else {
item.setEditable(false);
Expand All @@ -647,6 +661,11 @@ window.filamentGoogleMaps = ($wire, config) => {

this.overlays.forEach(function (item) {
item.setEditable(false);
item.setOptions({
// strokeColor: '#f06eaa'
strokeColor: '#00ff00',
strokeOpacity: '0.5'
});
});
},
}
Expand Down

0 comments on commit dccf65e

Please sign in to comment.