[Script] WME Aerial Shifter 1.6.5 / 06.06.2016

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

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 Aerial Shifter 1.6.5 / 06.06.2016

Postby foxitrot » Fri Jul 01, 2016 3:37 pm

A question to the current maintainers of the various WAS functionality scripts (I'm posting the wish here not only because Iain's thread is currently said to be a read-only blog of the author's achievements) :-P
Would someone be able / mind / willing to implement the aerials' shifting by dragging the aerials layer with mouse? (It would possibly need one more button to activate the dragging.) This would add the process the missed intuitiveness.

Sent from a touch display, which took care of perfectly scrambling my thoughts.
foxitrot
Waze Global Champs
Waze Global Champs
 
Posts: 14395
Joined: Thu Jul 14, 2011 10:22 pm
Location: Slovakia
Has thanked: 2546 times
Been thanked: 1151 times

Re: [Script] Waze Aerial Shifter Extension for Chrome (fixed

Postby iainhouse » Sat Jun 22, 2013 5:00 pm

Damn good work, that man. :mrgreen: I tried (& failed) to fix it myself - I'll have to dig in and see what you did. :)

If the quality of the aerials increases with the addition of Google Aerials, this script is only going to become more useful.
iainhouse
Country Manager
Country Manager
 
Posts: 17114
Joined: Mon Jul 23, 2012 5:16 pm
Location: on the road from London to insanity, with Waze HQ in the driving seat
Has thanked: 1780 times
Been thanked: 6107 times

Re: [Script] Waze Aerial Shifter Extension for Chrome (fixed

Postby iainhouse » Mon Jun 24, 2013 5:43 pm

berestovskyy wrote:Do you guys have the same issue, when you pan the map it's shifting back to (0,0)?


Yes, I'm afraid so. Didn't see this happening before - maybe something minor has changed in WME?

I'm pretty sure that after you got it working, it was almost the opposite: changing the values had no effect until panning the map.

[EDIT] Ignore the above (for the moment). Just realised I had another aerial shifter script installed. That was definitely responsible for the map not shifting as I changed the values. :oops:

I'll post again when I've done some more testing.
iainhouse
Country Manager
Country Manager
 
Posts: 17114
Joined: Mon Jul 23, 2012 5:16 pm
Location: on the road from London to insanity, with Waze HQ in the driving seat
Has thanked: 1780 times
Been thanked: 6107 times

Re: [Script] Waze Aerial Shifter Extension for Chrome (fixed

Postby iainhouse » Mon Jun 24, 2013 6:01 pm

OK, definitely still reverting back to an un-shifted state after panning the map.

What I said above (not shifting when the values in the input boxes are changed) - not a real problem. It was caused by the other (non-working) script.

I do have a solution. Since I freely admit I only have a vague idea what I'm messing with, this could be elegant or it could be a major kludge. :lol:

I have added the following code to force a shift update after panning:
Code: Select all
   wazeMap.events.on({
      moveend : update
   });


There's probably a proper syntax to combine it with the "zoomend" event trigger, but I don't know what it is. :oops:
iainhouse
Country Manager
Country Manager
 
Posts: 17114
Joined: Mon Jul 23, 2012 5:16 pm
Location: on the road from London to insanity, with Waze HQ in the driving seat
Has thanked: 1780 times
Been thanked: 6107 times

Re: [Script] Waze Aerial Shifter Extension for Chrome

Postby iainhouse » Mon Aug 26, 2013 3:42 pm

I can offer some help. I can't fix the script proper, but I have identified the changes necessary and you can patch your own script until the author can update the proper script.

You will need to locate the un-packaged script where it is stored on your computer. First, open your Chrome Extensions tab. Each extension tab has a long ID: for my Waze Aerial Shifter, that ID is mjbppgkbhhfenndnpmblmdkegklllppk.

You then need to locate the script. I found it at %userprofile%\Local Settings\Application Data\Google\Chrome\User Data\Default\Extensions\mjbppgkbhhfenndnpmblmdkegklllppk\1.2.13_0 - on Windows, obviously! If you have a version other than XP, I'm not sure where it would be. It might be easier to search for a file containing the string "@name Waze Aerial Shifter" that appears in a similar location.

Once you've found the script, the change is relatively simple using a text editor such as Notepad. There are 2 instances of the string "OpenLayers.Layer.Bing_43" - change them both to "OpenLayers.Layer.Google_47". Save the script & refresh your browser.
iainhouse
Country Manager
Country Manager
 
Posts: 17114
Joined: Mon Jul 23, 2012 5:16 pm
Location: on the road from London to insanity, with Waze HQ in the driving seat
Has thanked: 1780 times
Been thanked: 6107 times

Re: [Script] WME Aerial Shifter (WAS)

Postby iainhouse » Fri Dec 06, 2013 1:08 am

I had a question posed to me today by dknight212 as to whether the opacity of the aerial layer could be reduced. Having referenced this script to find the name of the layer so I could experiment, I decided to go further. I edited my local copy of the script to include an entry for opacity (as a percentage).

Now I've done it for someone else, I've found it useful myself. Some of the new Google images are quite sharp and detract somewhat from the visibility of the roads - not to mention the difficulty in seeing city polygons.

I don't have the experience to package this as a separate script and it seems to be a good fit for the current script. I was wondering if you would consider incorporating the new functionality in the current script?

The code is below - the lines I have added all end with a //yy comment.

Code: Select all
$(function() {
   var nav = $('<div style="position:absolute;right:5px;bottom:36px">'
      + 'shift: <input type="text" style="width:30px;height:10px;vertical-align:baseline" class="sx" value="0"/> x '
      + '<input type="text" style="width:30px;height:10px;vertical-align:baseline" class="sy" value="0"/> m'
      + '   opacity: <input type="text" style="width:25px;height:10px;vertical-align:baseline" class="so" value="100"/> %' //yy
      + '</div>')
   ;
   var sx = nav.find('.sx');
   var sy = nav.find('.sy');
   var so = nav.find('.so'); //yy
   $('#site-navigation').append(nav);

   var cookiePrefix = 'WAS_';

   function loadFromCookies() {
      var val = $.cookie(cookiePrefix + 'sx');
      if (val !== null)
         sx.val(val);
      val = $.cookie(cookiePrefix + 'sy');
      if (val !== null)
         sy.val(val);
      val = $.cookie(cookiePrefix + 'so'); //yy
      if (val !== null) //yy
         so.val(val); //yy
   }

   function saveToCookies() {
      $.cookie(cookiePrefix + 'sx', sx.val(), {
         expires : 20 * 365
      });
      $.cookie(cookiePrefix + 'sy', sy.val(), {
         expires : 20 * 365
      });
      $.cookie(cookiePrefix + 'so', so.val(), { //yy
         expires : 20 * 365 //yy
      }); //yy
   }

   function update() {
      // Calculate meters per pixel factor of current map
      var ipu = OpenLayers.INCHES_PER_UNIT;
      var metersPerPixel = wazeMap.getResolution() * ipu['m']
         / ipu[wazeMap.getUnits()];
      var shiftX = parseInt(sx.val(), 10);
      var shiftY = parseInt(sy.val(), 10);

      // Apply the shift
      wazeMap.baseLayer.div.style.left =
         Math.round(shiftX / metersPerPixel) + 'px';
      wazeMap.baseLayer.div.style.top =
         Math.round(shiftY / metersPerPixel) + 'px';
      wazeMap.baseLayer.div.style.opacity = so.val()/100; //yy

      saveToCookies();
   }
   loadFromCookies();

   update();

   wazeMap.events.on({
      zoomend : update,
      moveend : update
   });
   wazeMap.baseLayer.events.on({
      loadend : update,
   });
   sx.change(update);
   sy.change(update);
   so.change(update); //yy
});
iainhouse
Country Manager
Country Manager
 
Posts: 17114
Joined: Mon Jul 23, 2012 5:16 pm
Location: on the road from London to insanity, with Waze HQ in the driving seat
Has thanked: 1780 times
Been thanked: 6107 times

Re: [Script] WME Aerial Shifter 1.5 / 10.09.2014

Postby iainhouse » Mon Jan 26, 2015 9:27 pm

It appears to be working OK here. ROW, but I would be pretty surprised if that made a difference.

Normally what breaks this script is when Waze change the name of the aerials layer so the script can no longer reference it.
iainhouse
Country Manager
Country Manager
 
Posts: 17114
Joined: Mon Jul 23, 2012 5:16 pm
Location: on the road from London to insanity, with Waze HQ in the driving seat
Has thanked: 1780 times
Been thanked: 6107 times

Re: [Script] WME Aerial Shifter 1.5 / 10.09.2014

Postby iainhouse » Thu Jan 28, 2016 8:05 pm

It's only you and it hasn't stopped working. :lol:

I saw something on the Toolbox thread about the "force full-screen" option being removed because it's not needed any more. WME Aerial Shifter places it's inputs on the top part of the screen. which is hidden when WME is in full-screen mode.

If you press SHIFT-F to toggle full-screen mode, you should find your inputs and they should still be working. :)
iainhouse
Country Manager
Country Manager
 
Posts: 17114
Joined: Mon Jul 23, 2012 5:16 pm
Location: on the road from London to insanity, with Waze HQ in the driving seat
Has thanked: 1780 times
Been thanked: 6107 times

Re: [Script] WME Aerial Shifter 1.5 / 10.09.2014

Postby iainhouse » Mon Feb 15, 2016 8:39 pm

james890526 wrote:iainhouse, I just realised that some icons and buttons e.g. reset button are missing/not found in WME Beta. Could you kindly counter check if it's only happening in my PC?

I can't really do that! I don't know what scripts you have running, or how any of them may be affected by changes in WME Beta.

As far as this script, WME Aerial Shifter, is concerned, I can confirm that it is no longer functional in WME Beta. It is probably still possible to make it work, but the script places it's controls in the top bar of the editor - where you can access your editor settings, change server etc. This top bar is what can be hidden/shown by pressing SHIFT-F in the current production editor.

Looking at WME Beta, this bar no longer exists: the "official" contents of it are now a tab in the left-hand pane. That means the element that WAS tries to add it's controls to no longer exists. I've just spent about 40 minutes trying to hack the script to display somewhere else but, frankly, I don't really know what I'm doing and I haven't had any success. It's even possible that the script is failing to load entirely: I can't find it in the list of sources when I load WME Beta.

I'm afraid you might have to wait until the original author can update the script.
iainhouse
Country Manager
Country Manager
 
Posts: 17114
Joined: Mon Jul 23, 2012 5:16 pm
Location: on the road from London to insanity, with Waze HQ in the driving seat
Has thanked: 1780 times
Been thanked: 6107 times

Re: [Script] WME Aerial Shifter 1.5 / 10.09.2014

Postby iainhouse » Tue May 24, 2016 8:36 pm

james890526 wrote:iainhouse, I understand that you're busy with your life, but ragacs has done a good job here updating the script. Hopefully you can update this to the newer version

As I mentioned above, I'm not the author of this script, so I can't update the original version!

However, ragac's version seems to be working fine with the latest WME version.
iainhouse
Country Manager
Country Manager
 
Posts: 17114
Joined: Mon Jul 23, 2012 5:16 pm
Location: on the road from London to insanity, with Waze HQ in the driving seat
Has thanked: 1780 times
Been thanked: 6107 times

PreviousNext

Return to Addons, Extensions, and Scripts

Who is online

Users browsing this forum: buckeyemondo, dfortney, GabryelTeixeira11, jm6087, MapOMatic