[Script] WME Image Overlays (1.4.2)

Discussion for the unofficial, community-developed addons, extensions and scripts built for the Waze Map Editor.

The official index of these tools is the Community Plugins, Extensions and Tools wiki page.

Moderators: Unholy, bextein, Glodenox, JustinS83

Forum rules
Discussion for the unofficial, community-developed addons, extensions and scripts built for the Waze Map Editor.

DO NOT START a new thread unless it is about a new idea. Keep discussion of existing tools within the main thread for that tool.

The official index of these tools is the Community Plugins, Extensions and Tools wiki page.

Re: [Script] WME Image Overlays (1.0.2)

Postby Glodenox » Wed Jun 13, 2018 7:00 am

I'll take a look at it (GitHub issue). If I remember correctly how I implemented that message, a small screen resolution could indeed cause the button to not be visible.
Belgium & Luxembourg Coordinator • Script Writing Community Coordinator
[ img ][ img ]
Glodenox
Waze Global Champs
Waze Global Champs
 
Posts: 1214
Joined: Tue Aug 11, 2015 9:04 pm
Location: Belgium
Has thanked: 696 times
Been thanked: 1358 times

Re: [Script] WME Image Overlays (1.1.0)

Postby Glodenox » Fri Jun 15, 2018 11:46 pm

Version 1.1.0 of the script has just been released!
The following fixes were applied:

Data sources notification message might not display completely on small screens
It was a bit harder to fix than I hoped, but it'll work much better now. Sadly enough I did have to make a small style change to an element that most scripts use: the tab-content container. However, the only change I made was making it stretch all the height it can stretch, which shouldn't affect any userscript negatively (it might even affect them positively!). Still, I don't like meddling with the Waze-styled elements.

Don't move the map if the image overlay is already visible at the current location
Whenever the image is ever so slightly still visible in the area you're currently looking at on the map, the map will not be panned and zoomed to the location of the image you just activated.

Allow fast hiding of the image while it is being added
It is now possible to click on the active image to make it hide again. This feels more natural than clicking the "hide overlay" button. I'll still keep the button though, just in case someone doesn't realise you can just click the name again to hide it.
I'm somewhat considering the ability to show more than one image at a time, though it would require changes to the script at several locations, so I'm a bit hesitant. I haven't experienced any use cases for this feature yet.

Disable "add overlay" button while you're adding an overlay
This one seems logical, but it wasn't there. Clicking the button again had some weird effects, so it needed to be fixed.

I've noticed that the "hide overlay" button appears when you're adding an image overlay (just after you chose your picture). Using that button makes the image go away, getting you stuck. I'll fix this in a later version. Maybe by just removing that button after all. Feel free to say what you think about that! :)

Also, you'll notice this version doesn't include the export and import functionality. I still haven't found why my code isn't working, so I put that feature on a side track for now. But don't worry! The code is safe and I'll try again later.
Belgium & Luxembourg Coordinator • Script Writing Community Coordinator
[ img ][ img ]
Glodenox
Waze Global Champs
Waze Global Champs
 
Posts: 1214
Joined: Tue Aug 11, 2015 9:04 pm
Location: Belgium
Has thanked: 696 times
Been thanked: 1358 times

Re: [Script] WME Image Overlays (1.1.0)

Postby Glodenox » Sat Jun 30, 2018 11:39 am

I'm sorry to hear that is happening. Could you tell me which image you tried to store? I'm sort of suspecting the Indexed DB system I'm using in the background can't handle big images too well.

A more technical question: do you happen to see any error messages within the web console of the WME page? You can check the web console by pressing Ctrl+Shift+i at the page and selecting the Console tab in either Firefox or Chrome. It's probably best to filter the results by entering "Image Overlays". The messages about the user-info element not being available yet are normal.

I'm also starting to wonder whether I should support other ways of including an image as well. Do you guys think it would be practical if you could provide a link to an image instead? In my usage of the script I haven't really had a situation where I could just refer to an image that is available online. The big downsides I see is that the image could be blocked if it gets loaded within the WME (which will only be visible next time you try to use it due to caching) AND that the image could get removed over time on the source website.
Belgium & Luxembourg Coordinator • Script Writing Community Coordinator
[ img ][ img ]
Glodenox
Waze Global Champs
Waze Global Champs
 
Posts: 1214
Joined: Tue Aug 11, 2015 9:04 pm
Location: Belgium
Has thanked: 696 times
Been thanked: 1358 times

Re: [Script] WME Image Overlays (1.1.0)

Postby Glodenox » Sat Jun 30, 2018 1:49 pm

(we've continued on the issue in PM)

I've just been reading into it more. It seems like Chrome has recently adjusted how it decides whether something gets persisted over sessions. I think I'll need to explicitly ask permission for persistent storage. Either way, I'll look into it.
Belgium & Luxembourg Coordinator • Script Writing Community Coordinator
[ img ][ img ]
Glodenox
Waze Global Champs
Waze Global Champs
 
Posts: 1214
Joined: Tue Aug 11, 2015 9:04 pm
Location: Belgium
Has thanked: 696 times
Been thanked: 1358 times

Re: [Script] WME Image Overlays (1.1.0)

Postby Glodenox » Wed Aug 01, 2018 12:37 pm

I've been investigating the issue of persistent storage a bit more.

In Firefox I will make the script pop up a prompt that asks whether the data may be stored persistently. This way it will become very unlikely that the data would ever by removed by the browser.

In Google Chrome there is no way to ask for this permission. I can only check whether data is stored persistently or not and decide to display a warning to notify you when it isn't. Chrome will only allow the persistent storage if one of the following conditions is true:
  • The site is bookmarked (and the user has 5 or less bookmarks)
  • The site has high site engagement
  • The site has been added to home screen
  • The site has push notifications enabled
Not ideal, but it's the best I can do.
Belgium & Luxembourg Coordinator • Script Writing Community Coordinator
[ img ][ img ]
Glodenox
Waze Global Champs
Waze Global Champs
 
Posts: 1214
Joined: Tue Aug 11, 2015 9:04 pm
Location: Belgium
Has thanked: 696 times
Been thanked: 1358 times

Re: [Script] WME Image Overlays (1.2.0)

Postby Glodenox » Wed Aug 01, 2018 2:47 pm

Version 1.2.0 has just been released with the new persistent storage permission request whenever you add a new image overlay. If you are using Google Chrome, I'd highly advice to add the WME to your favourites so the storage can become persistent.

I hope this will solve the sporadic disappearing of image overlays. I still intend to support the exporting and importing of these images, but I haven't been able to figure out what is going wrong yet.
Belgium & Luxembourg Coordinator • Script Writing Community Coordinator
[ img ][ img ]
Glodenox
Waze Global Champs
Waze Global Champs
 
Posts: 1214
Joined: Tue Aug 11, 2015 9:04 pm
Location: Belgium
Has thanked: 696 times
Been thanked: 1358 times

Re: [Script] WME Image Overlays (1.2.0)

Postby Glodenox » Wed Aug 01, 2018 10:36 pm

That's the idea behind the feature, yes. Storing the location, rotation and scaling isn't too hard. It's the "storing the image" that is currently not working as I'd expect it to.

But just to be clear: that feature is not yet part of this release.
Belgium & Luxembourg Coordinator • Script Writing Community Coordinator
[ img ][ img ]
Glodenox
Waze Global Champs
Waze Global Champs
 
Posts: 1214
Joined: Tue Aug 11, 2015 9:04 pm
Location: Belgium
Has thanked: 696 times
Been thanked: 1358 times

Re: [Script] WME Image Overlays (1.2.0)

Postby Glodenox » Sun Sep 30, 2018 8:06 am

When I made this layout I never expected those buttons to stay longer than a week or two (I thought about using handles to adjust the image size and location), so I didn't really optimize it. Both suggestions are indeed an improvement. I won't be able to work on it right now, but I've put it on the backlog.
Belgium & Luxembourg Coordinator • Script Writing Community Coordinator
[ img ][ img ]
Glodenox
Waze Global Champs
Waze Global Champs
 
Posts: 1214
Joined: Tue Aug 11, 2015 9:04 pm
Location: Belgium
Has thanked: 696 times
Been thanked: 1358 times

Re: [Script] WME Image Overlays (1.2.0)

Postby Glodenox » Wed Nov 21, 2018 9:26 pm

That is indeed the idea behind that functionality. You'd export a json file which contains all the attributes as well as the image itself. It's the image which currently seems to be causing some issue in the import at the moment. Though when I say "currently", I must admit that it has been 4 months since I tried to fix anything in that code.
Belgium & Luxembourg Coordinator • Script Writing Community Coordinator
[ img ][ img ]
Glodenox
Waze Global Champs
Waze Global Champs
 
Posts: 1214
Joined: Tue Aug 11, 2015 9:04 pm
Location: Belgium
Has thanked: 696 times
Been thanked: 1358 times

Re: [Script] WME Image Overlays (1.3.0)

Postby Glodenox » Sun Jan 06, 2019 7:08 pm

I was intending on working on another script today, but I found the challenge to get that feature finished too alluring and started working on that instead. The import was slightly more convoluted than I had hoped (the script has to copy over the data byte by byte), but it seems to work fine.

Version 1.3.0 finally has the much requested import/export functionality working! It is perfectly possible to share these exports with other editors, nothing in the export is user-specific.

I didn't work on compacting the image alignment controls yet, that'll be for another update.
Belgium & Luxembourg Coordinator • Script Writing Community Coordinator
[ img ][ img ]
Glodenox
Waze Global Champs
Waze Global Champs
 
Posts: 1214
Joined: Tue Aug 11, 2015 9:04 pm
Location: Belgium
Has thanked: 696 times
Been thanked: 1358 times

PreviousNext

Return to Addons, Extensions, and Scripts

Who is online

Users browsing this forum: n4dog, umopapisdn, YanisKyr