[Script] WME Aerial Shifter (WAS) 1.4.5 / 05.02.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.

Moderators: krankyd, 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] WME Aerial Shifter (WAS) 1.4.4 / 10.01.2014

Postby berestovskyy » Fri Jan 10, 2014 8:56 am

v1.4.4:
- fixed panel width
- added link to the forum page
berestovskyy
Beta tester
Beta tester
 
Posts: 827
Joined: Fri Jul 15, 2011 1:50 pm
Has thanked: 165 times
Been thanked: 394 times

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

Postby berestovskyy » Wed Feb 05, 2014 1:39 pm

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
berestovskyy
Beta tester
Beta tester
 
Posts: 827
Joined: Fri Jul 15, 2011 1:50 pm
Has thanked: 165 times
Been thanked: 394 times

Re: [Script] WME Aerial Shifter (WAS) 1.4.3 / 08.01.2014

Postby fmondini » Thu Jan 09, 2014 8:45 am

A little misalignment... (1.4.3)

WAS-ma.jpg
WAS-ma.jpg (76.69 KiB) Viewed 660 times
Global Champ and Scripting Expert
Sony Tablet S, Samsung Galaxy Note 2
WME-TOOLS suite author, check it out!


ImageImageImageImage
fmondini
Waze Global Champs
Waze Global Champs
 
Posts: 282
Joined: Sat Sep 08, 2012 10:24 am
Location: Northern Italy
Has thanked: 213 times
Been thanked: 152 times

Re: [Script] WME Aerial Shifter (WAS) 1.4.3 / 08.01.2014

Postby fmondini » Thu Jan 09, 2014 2:38 pm

berestovskyy wrote:
fmondini wrote:A little misalignment... (1.4.3)

Suggest a patch?

I mean: the opacity percent box is dropped on the line below :-)
Global Champ and Scripting Expert
Sony Tablet S, Samsung Galaxy Note 2
WME-TOOLS suite author, check it out!


ImageImageImageImage
fmondini
Waze Global Champs
Waze Global Champs
 
Posts: 282
Joined: Sat Sep 08, 2012 10:24 am
Location: Northern Italy
Has thanked: 213 times
Been thanked: 152 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.
UK Country Administrator • AM: London (DELETED), S Wales
Waze 3.7.2 • iPhone 4S (iOS 6.1.3) • Chrome/XP
Community Champ
ImageImage
UK WikiWaze FAQ
My name is Iain and I'm a Wazaholic. I last edited 1 hour ago.
iainhouse
 
Posts: 2218
Joined: Mon Jul 23, 2012 5:16 pm
Location: London, UK
Has thanked: 365 times
Been thanked: 893 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.
UK Country Administrator • AM: London (DELETED), S Wales
Waze 3.7.2 • iPhone 4S (iOS 6.1.3) • Chrome/XP
Community Champ
ImageImage
UK WikiWaze FAQ
My name is Iain and I'm a Wazaholic. I last edited 1 hour ago.
iainhouse
 
Posts: 2218
Joined: Mon Jul 23, 2012 5:16 pm
Location: London, UK
Has thanked: 365 times
Been thanked: 893 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.2 • iPhone 4S (iOS 6.1.3) • Chrome/XP
Community Champ
ImageImage
UK WikiWaze FAQ
My name is Iain and I'm a Wazaholic. I last edited 1 hour ago.
iainhouse
 
Posts: 2218
Joined: Mon Jul 23, 2012 5:16 pm
Location: London, UK
Has thanked: 365 times
Been thanked: 893 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.2 • iPhone 4S (iOS 6.1.3) • Chrome/XP
Community Champ
ImageImage
UK WikiWaze FAQ
My name is Iain and I'm a Wazaholic. I last edited 1 hour ago.
iainhouse
 
Posts: 2218
Joined: Mon Jul 23, 2012 5:16 pm
Location: London, UK
Has thanked: 365 times
Been thanked: 893 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.2 • iPhone 4S (iOS 6.1.3) • Chrome/XP
Community Champ
ImageImage
UK WikiWaze FAQ
My name is Iain and I'm a Wazaholic. I last edited 1 hour ago.
iainhouse
 
Posts: 2218
Joined: Mon Jul 23, 2012 5:16 pm
Location: London, UK
Has thanked: 365 times
Been thanked: 893 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
Coordinator/Country Manager/Local Champ/Forum Moderator
WME Editing Expert, Beta Editor Expert
ImageImage
JorgeARestrepo
Local Champ Mentor
Local Champ Mentor
 
Posts: 1140
Joined: Tue Mar 20, 2012 3:19 am
Location: Medellín, Colombia
Has thanked: 529 times
Been thanked: 604 times

PreviousNext

Return to Addons, Extensions, and Scripts

Who is online

Users browsing this forum: No registered users