[Script] WME Aerial Shifter 1.5 / 10.09.2014

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.

Moderator: Unholy

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] 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.
UK Country Administrator
AM: London (DELETED), S Wales
Waze 3.7.3 • iPhone 4S (iOS 6.1.3) • Chrome/XP
ImageImage
UK WikiWaze FAQ
I want to go to a commune in Vermont and deal with no unit of time shorter than a season
iainhouse
Country Manager
Country Manager
 
Posts: 4694
Joined: Mon Jul 23, 2012 5:16 pm
Location: on the road from London to insanity
Has thanked: 783 times
Been thanked: 2269 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:
UK Country Administrator
AM: London (DELETED), S Wales
Waze 3.7.3 • iPhone 4S (iOS 6.1.3) • Chrome/XP
ImageImage
UK WikiWaze FAQ
I want to go to a commune in Vermont and deal with no unit of time shorter than a season
iainhouse
Country Manager
Country Manager
 
Posts: 4694
Joined: Mon Jul 23, 2012 5:16 pm
Location: on the road from London to insanity
Has thanked: 783 times
Been thanked: 2269 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.
UK Country Administrator
AM: London (DELETED), S Wales
Waze 3.7.3 • iPhone 4S (iOS 6.1.3) • Chrome/XP
ImageImage
UK WikiWaze FAQ
I want to go to a commune in Vermont and deal with no unit of time shorter than a season
iainhouse
Country Manager
Country Manager
 
Posts: 4694
Joined: Mon Jul 23, 2012 5:16 pm
Location: on the road from London to insanity
Has thanked: 783 times
Been thanked: 2269 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
});
UK Country Administrator
AM: London (DELETED), S Wales
Waze 3.7.3 • iPhone 4S (iOS 6.1.3) • Chrome/XP
ImageImage
UK WikiWaze FAQ
I want to go to a commune in Vermont and deal with no unit of time shorter than a season
iainhouse
Country Manager
Country Manager
 
Posts: 4694
Joined: Mon Jul 23, 2012 5:16 pm
Location: on the road from London to insanity
Has thanked: 783 times
Been thanked: 2269 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.
UK Country Administrator
AM: London (DELETED), S Wales
Waze 3.7.3 • iPhone 4S (iOS 6.1.3) • Chrome/XP
ImageImage
UK WikiWaze FAQ
I want to go to a commune in Vermont and deal with no unit of time shorter than a season
iainhouse
Country Manager
Country Manager
 
Posts: 4694
Joined: Mon Jul 23, 2012 5:16 pm
Location: on the road from London to insanity
Has thanked: 783 times
Been thanked: 2269 times

Re: [Script] WME Aerial Shifter 1.5 / 10.09.2014

Postby james890526 » Wed Sep 24, 2014 10:27 am

wlodek76 wrote:Sometimes we need to do a small correction of sat images, so steps ± 10 are too large and we need to enter values manually then.

±1 is more handy here

max="100" min="-100" step="1"

Regards,
Włodzimierz


Good suggestion. Was wondering why the step size is +-10 and not 1.
james890526

Image Image

Waze in Malaysia
  • Area Manager : Penang mainland, Kulim
  • Beta Tester
james890526
Wiki Master
Wiki Master
 
Posts: 109
Joined: Sun Jun 22, 2014 7:00 pm
Has thanked: 36 times
Been thanked: 20 times

Re: [Script] WME Aerial Shifter (WAS)

Postby JorgeARestrepo » Fri Jan 24, 2014 8:55 pm

iainhouse wrote: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 would like to reduce the opacity of GPS Points together with (or instead of) the aerial layer.
...
JorgeARestrepo - Colombia
Global Champ/Coordinator/Country Manager/Forum Moderator
WME Editing Expert, Beta Editor Expert
Image
JorgeARestrepo
Waze Global Champs
Waze Global Champs
 
Posts: 1421
Joined: Tue Mar 20, 2012 3:19 am
Location: Medellín, Colombia
Has thanked: 1015 times
Been thanked: 1000 times

Re: [Script] WME Aerial Shifter (WAS) 1.4.5 / 05.02.2014

Postby kadyus » Fri Sep 05, 2014 8:41 pm

berestovskyy wrote:05.02.2014 v1.4.5:
- NEW 'Reset defaults' icon
- compatibility with the latest WME beta
- changes for right-to-left languages etc.

The script is now available at the Chrome Web Store: link


no longer working with the latest WME beta. appreciate if you could update it. thanks. :)
Image
Area Manager - Sabah, Malaysia
WazeBORNEO FB /WazeMY FB /WazeMY G+
kadyus
Waze Local Champs
Waze Local Champs
 
Posts: 65
Joined: Fri Jan 11, 2013 10:05 am
Location: Sabah, Malaysia
Has thanked: 78 times
Been thanked: 30 times

Re: [Script] WME Aerial Shifter (WAS) 1.4.4 / 10.01.2014

Postby kentsmith9 » Fri Jan 31, 2014 9:53 am

berestovskyy, you do some incredible work my friend.

I was thinking the Wiki entry for WAS is pretty slim. We might want to explain why you would want to use this plug-in like when do you know you need it, what is it doing for the editor, etc. Similar to some of the other extensions in the Wiki.

Then are there drawbacks to using it meaning if you don't use it properly you can blah, blah, blah.
kentsmith9
Waze Global Champs
Waze Global Champs
 
Posts: 4414
Joined: Mon Apr 23, 2012 3:33 pm
Location: SF/SJ Bay Area of Northern California
Has thanked: 979 times
Been thanked: 1116 times

Re: [Script] WME Aerial Shifter 1.5 / 10.09.2014

Postby klos96 » Wed Oct 22, 2014 1:21 pm

It is an excellent tool
Carlos Salas
Image ImageImage
klos96
Waze Local Champs
Waze Local Champs
 
Posts: 147
Joined: Mon Sep 10, 2012 3:36 pm
Has thanked: 74 times
Been thanked: 53 times

PreviousNext

Return to Addons, Extensions, and Scripts

Who is online

Users browsing this forum: No registered users

cron