Difference between revisions of "User:Gizmoguy411"

From Wazeopedia
Line 7: Line 7:
  
 
http://www.waze.com/wiki/images/6/65/Waze_signature_200k_6c.png
 
http://www.waze.com/wiki/images/6/65/Waze_signature_200k_6c.png
 +
 +
!!!Sandbox Follows!!!
 +
 +
<html>
 +
  <head>
 +
    <meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
 +
    <title>Waze Bookmarklets</title>
 +
    <style> 
 +
      a.bookmarklet:link {font-family:verdana;font-size:small;font-weight:bold;border:2px dotted black;background-color:yellow;text-decoration:none;color:#009;padding-right:10px;padding-left:10px;}
 +
</style> </head>
 +
  <body>
 +
    <p><b>Waze Bookmarks and Bookmarklets for more efficient map editing</b><br>
 +
    </p>
 +
    <p>- Insure your browser's bookmark toolbar is enabled. Ctrl-Shift B.for
 +
      Chrome.<br>
 +
      - Drag the desired bookmark or bookmarklet into your booknmark toolbar.<br>
 +
      - Edit your toolbar to organize the links as desired.<br>
 +
      - Bookmarks open the North American versions.. URLs must be edited for
 +
      other parts of the world.</p>
 +
    <p><br>
 +
    </p>
 +
    <p><b></b></p>
 +
    <hr><b>BOOKMARKS:</b>
 +
    <p><a target="_blank" class="bookmarklet" href="http://waze.com/editor/" title="Open public Waze Map Editor (aka Papyrus or "
 +
 +
        new"="" editor)"="">WME</a> - Open public Waze Map Editor (aka Papyrus
 +
      or "New" Editor)<br>
 +
      <br>
 +
      <a target="_blank" class="bookmarklet" href="http://descartes.waze.com/beta/"
 +
 +
        title="Open &#946;eta (Decartes) Waze Map Editor">WME &#946;</a> - Open &#946;eta
 +
      (Descartes) Waze Map Editor<br>
 +
    </p>
 +
    <p><a target="_blank" class="bookmarklet" href="http://waze.com/cartouche_old/"
 +
 +
        title="Cartouche Map Editor (old editor)">Car</a> - Cartouche Map Editor
 +
      (old editor)</p>
 +
    <p><a target="_blank" class="bookmarklet" href="http://waze.com/forum" title="Open Waze Forum">Forum</a>
 +
      - Open Waze Forum</p>
 +
    <p><a target="_blank" class="bookmarklet" href="http://waze.com/wiki/" title="Open Waze Wiki site">Wiki</a>
 +
      - Open Waze Wiki site</p>
 +
    <p><a target="_blank" class="bookmarklet" href="http://www.waze.com/wiki/index.php/Michigan"
 +
 +
        title="Open the Waze Wiki Michigan Mapping Resources">Wiki/MI</a> - Open
 +
      the Waze Wiki Ohio Mapping Resources site (edit the URL and title
 +
      accordingly for your state) </p>
 +
    <p><a target="_blank" class="bookmarklet" href="http://www.waze.com/wiki/index.php/Ohio"
 +
 +
        title="Open the Waze Wiki Ohio Mapping Resources">Wiki/OH</a> - Open the
 +
      Waze Wiki Ohio Mapping Resources site (edit the URL and title accordingly
 +
      for your state)</p>
 +
    <p><br>
 +
    </p>
 +
    <p></p>
 +
    <hr>
 +
    <p><b>BOOKMARKLETS:</b><br>
 +
    </p>
 +
    <p><a class="bookmarklet" href="javascript:(function(){var center_lonlat=new OpenLayers.LonLat(g_cartouche.map.center.lon,g_cartouche.map.center.lat);center_lonlat.transform(new OpenLayers.Projection('EPSG:900913'),new OpenLayers.Projection('EPSG:4326'));window.open('http://'+window.location.hostname+'/editor/?zoom='+(g_cartouche.map.zoom)+'&amp;lon='+center_lonlat.lon+'&amp;lat='+center_lonlat.lat,'Papyrus');})();"
 +
 +
        title="Open new window in WME from Cartouche Editor window">Car &#8594; WME</a>
 +
      - Open new WME window from Cartouche Editor window</p>
 +
    <p><a class="bookmarklet" href="javascript:(function(){var center_lonlat=new OpenLayers.LonLat(wazeMap.center.lon,wazeMap.center.lat);center_lonlat.transform(new OpenLayers.Projection('EPSG:900913'),new OpenLayers.Projection('EPSG:4326'));window.open('http://'+window.location.hostname+'/cartouche_old/?zoom='+(wazeMap.zoom)+'&amp;lon='+center_lonlat.lon+'&amp;lat='+center_lonlat.lat,'oldCartouche');})();"
 +
 +
        title="Open new window in Cartouche Editor from WME window">WME &#8594; Car</a>
 +
      - Open new Cartouche Editor window from WME window</p>
 +
    <p><a class="bookmarklet" href="javascript:(function(){var center_lonlat=new OpenLayers.LonLat(wazeMap.center.lon,wazeMap.center.lat);center_lonlat.transform(new OpenLayers.Projection ('EPSG:900913'),new OpenLayers.Projection('EPSG:4326'));window.open('http://'+window.location.hostname+'/livemap/?zoom='+(wazeMap.zoom<5 ? wazeMap.zoom+11 : 15)+'&amp;lon='+center_lonlat.lon+'&amp;lat='+center_lonlat.lat,'LiveMap');})();"
 +
 +
        title="Open new window in Live Maps from WME window">WME &#8594; Live</a> -
 +
      Open new Live Maps window from WME window<br>
 +
    </p>
 +
    <p><a class="bookmarklet" href="javascript:(function(){var center_lonlat=OpenLayers.Layer.SphericalMercator.inverseMercator(g_map.getCenter().lon,g_map.getCenter().lat);var mapZoom=(window.location.hostname=='world.waze.com' ? (g_map.zoom>6 ? (g_map.zoom>7 ? g_map.zoom-5 : g_map.zoom-6) : 0) : (g_map.zoom>10 ? g_map.zoom-11 : 0));window.open('http://'+window.location.hostname+'/editor/?zoom='+mapZoom+'&amp;lon='+center_lonlat.lon+'&amp;lat='+center_lonlat.lat,'Waze Map Editor');})();"
 +
 +
        title="Open new window in WME from Live Maps window">Live &#8594; WME</a> -
 +
      Open new WME window from Live Maps window</p>
 +
    <p><a class="bookmarklet" href="javascript:(function(){var center_lonlat=new OpenLayers.LonLat(wazeMap.center.lon,wazeMap.center.lat);center_lonlat.transform(new OpenLayers.Projection('EPSG:900913'),new OpenLayers.Projection('EPSG:4326'));window.open('http://www.mcgi.state.mi.us/mapmichigan/map.asp?lat='+center_lonlat.lat+'&amp;lon='+center_lonlat.lon+'&amp;action=xy&amp;msrv=1','Mich Map');})();"
 +
 +
        title="Open new window in Map Michigan from WME window">WME &#8594; MI</a> -
 +
      Open new Map Michigan window from WME window</p>
 +
    <p><br>
 +
    </p>
 +
    <p><b></b></p>
 +
    <hr>
 +
    <p><b>PROHIBITED BOOKMARKLETS: (Waze prohibits distribution of these
 +
        bookmarklets as they could contribute to copyright violations. Do NOT
 +
        distribute!)<br>
 +
      </b></p>
 +
    <p><a class="bookmarklet" href="javascript:(function(){var center_lonlat = new OpenLayers.LonLat(g_cartouche.map.center.lon,g_cartouche.map.center.lat);center_lonlat.transform(new OpenLayers.Projection(&quot;EPSG:900913&quot;), new OpenLayers.Projection(&quot;EPSG:4326&quot;));window.open('http://maps.google.com/maps?q='+center_lonlat.lat+','+center_lonlat.lon+'&amp;z='+ (g_cartouche.map.zoom+12));})();"
 +
 +
        epsg:900913"),new="" openlayers.projection("epsg:4326"));window.open('http:=""
 +
 +
        maps.google.com="" maps?q="+center_lonlat.lat+" ,'+center_lonlat.lon+'&z="+ (wazeMap.zoom+12),"
 +
 +
        google="" maps');})();"="" title="Open new tab in Google Maps from Cartouche Editor window">Car
 +
        &#8594; GMap</a> - Open new Google Maps window from Cartouche Editor window</p>
 +
    <p><a class="bookmarklet" href="javascript:(function(){var center_lonlat=new OpenLayers.LonLat(wazeMap.center.lon,wazeMap.center.lat);center_lonlat.transform(new OpenLayers.Projection(&quot;EPSG:900913&quot;),new OpenLayers.Projection(&quot;EPSG:4326&quot;));window.open('http://maps.google.com/maps?q='+center_lonlat.lat+','+center_lonlat.lon+'&amp;z='+ (wazeMap.zoom+12),'Google Maps');})();"
 +
 +
        epsg:900913"),new="" openlayers.projection("epsg:4326"));window.open('http:=""
 +
 +
        maps.google.com="" maps?q="+center_lonlat.lat+" ,'+center_lonlat.lon+'&z="+ (wazeMap.zoom+12),"
 +
 +
        google="" maps');})();"="" title="Open new tab in Google Maps from WME window">WME
 +
        &#8594; GMap</a> - Open new Google Maps window from WME window</p>
 +
    <p><br>
 +
    </p>
 +
    <p></p>
 +
    <hr>
 +
    <p><b>EXPERIMENTAL BOOKMARKLETS: (DO NOT DISTRIBUTE)</b></p>
 +
    <p><a class="bookmarklet" href='javascript:(function() { Object.forEach(wazeModel.nodes.objects, function(nodeid, node) { var fixme = false; var disco = []; var connections = {}; var geo = wazeMap.getExtent().toGeometry(); if (node.attributes.segIDs.length > 1 &amp;&amp; geo.containsPoint(node.geometry)) { for (var i = 0; i < node.attributes.segIDs.length; i++) { var segid = node.attributes.segIDs[i]; var seg = wazeModel.segments.get(segid); if (seg) { if (seg.attributes.separator) { wazeModel.actionManager.add(new Waze.Action.UpdateSegmentDetails(seg, {separator: false})); } var segments = []; segments.push(seg); if (seg.attributes.fwdTurnsLocked == false &amp;&amp; seg.attributes.toNodeID == nodeid) { fixme = true; } if (seg.attributes.revTurnsLocked == false &amp;&amp; seg.attributes.fromNodeID == nodeid) { fixme = true; } if (seg.attributes.toNodeID == seg.attributes.fromNodeID &amp;&amp; !seg.attributes.junctionID) { wazeModel.actionManager.add(new Waze.Action.DisconnectSegment(seg, node)); var oldGeo = seg.geometry.clone(); var newGeo = seg.geometry.clone(); var isOdd = seg.geometry.components.length % 2; var joinsegs = []; for (var i = 0; i < seg.geometry.components.length / 2 - 1; i++) { newGeo.components.pop(); oldGeo.components.shift(); } if (isOdd == 0) { oldGeo.components.shift(); } joinsegs.push(seg); wazeModel.actionManager.add(new Waze.Action.UpdateSegmentGeometry(seg, seg.geometry, newGeo)); var newseg = new Waze.Feature.Vector.Segment(oldGeo); newseg.attributes.fwdDirection = seg.attributes.fwdDirection; newseg.attributes.fwdToll = seg.attributes.fwdToll; newseg.attributes.level = seg.attributes.level; newseg.attributes.locked = seg.attributes.locked; newseg.attributes.primaryStreetID = seg.attributes.primaryStreetID; newseg.attributes.rank = seg.attributes.rank; newseg.attributes.revDirection = seg.attributes.revDirection; newseg.attributes.revToll = seg.attributes.revToll; newseg.attributes.roadType = seg.attributes.roadType; newseg.attributes.separator = seg.attributes.separator; newseg.attributes.type = seg.attributes.type; wazeModel.actionManager.add(new Waze.Action.AddSegment(newseg)); joinsegs.push(newseg); wazeModel.actionManager.add(new Waze.Action.AddNode(seg.geometry.components.last(), joinsegs)); wazeModel.actionManager.add(new Waze.Action.ConnectSegment(node, newseg)); wazeModel.actionManager.add(new Waze.Action.ConnectSegment(node, seg)); wazeModel.actionManager.add(new Waze.Action.ModifyAllConnections(node, false)); wazeModel.actionManager.add(new Waze.Action.ModifyAllConnections(node, true)); wazeModel.actionManager.add(new Waze.Action.ModifyAllConnections(wazeModel.nodes.get(seg.attributes.toNodeID), false)); wazeModel.actionManager.add(new Waze.Action.ModifyAllConnections(wazeModel.nodes.get(seg.attributes.toNodeID), true)); } if (seg.attributes.toNodeID == null) { wazeModel.actionManager.add(new Waze.Action.AddNode(seg.geometry.components.last(), segments)); } if (seg.attributes.fromNodeID == null) { wazeModel.actionManager.add(new Waze.Action.AddNode(seg.geometry.components.first(), segments)); } } } Object.forEach(node.attributes.connections, function(connection, allowed) { var segs = connection.split(","); var segFrom = wazeModel.segments.get(segs.first()); var segTo = wazeModel.segments.get(segs.last()); connections[connection] = allowed; if (segs.first() == segs.last() &amp;&amp; allowed == true) { if (wazeModel.segments.get(segs.first())) { fixme = true; disco.push(segs.first()); } } if ((segFrom.attributes.toNodeID == nodeid &amp;&amp; segFrom.attributes.fwdDirection == false) || (segFrom.attributes.fromNodeID == nodeid &amp;&amp; segFrom.attributes.revDirection == false) || (segTo.attributes.toNodeID == nodeid &amp;&amp; segTo.attributes.revDirection == false) || (segTo.attributes.fromNodeID == nodeid &amp;&amp; segTo.attributes.fwdDirection == false)) { fixme = true; } }); if (fixme) { for (var i = 0; i < disco.length; i++) { console.log("SelfConn: " + disco[i]); wazeModel.actionManager.add(new Waze.Action.DisconnectSegment(wazeModel.segments.get(disco[i]), node, {deleteNode: false})); wazeModel.actionManager.add(new Waze.Action.ConnectSegment(node, wazeModel.segments.get(disco[i]))); } console.log("QW Node: " + node.fid); wazeModel.actionManager.add(new Waze.Action.ModifyAllConnections(node, false)); wazeModel.actionManager.add(new Waze.Action.ModifyAllConnections(node, true)); Object.forEach(node.attributes.connections, function(i, j) { var connSegs = i.split(","); if (j) { if (i in connections) { if (connections[i] == false) { console.log("false/true: disabling turn"); wazeModel.actionManager.add(new Waze.Action.ModifyConnection(parseInt(connSegs.first(), 10), node, parseInt(connSegs.last(), 10), false)); } } else { console.log("not in original connections, disabling turn"); wazeModel.actionManager.add(new Waze.Action.ModifyConnection(parseInt(connSegs.first(), 10), node, parseInt(connSegs.last(), 10), false)); } } }); } } }); var geo = wazeMap.getExtent'
 +
 +
        epsg:900913"),new="" openlayers.projection("epsg:4326"));window.open('http:=""
 +
 +
        maps.google.com="" maps?q="+center_lonlat.lat+" ,'+center_lonlat.lon+'&z="+ (wazeMap.zoom+12),"
 +
 +
        google="" maps');})();"="" title="Open new tab in Google Maps from WME window">FixAll</a>
 +
      - Fix all nodes in view (Beta editor only)<br>
 +
    </p>
 +
    <p><br>
 +
      <b></b></p>
 +
    <p><b><br>
 +
      </b></p>
 +
    <p>[Waze Bookmarklets.html, Edited 2012-10-19] <br>
 +
    </p>
 +
  </body>
 +
</html>

Revision as of 21:45, 27 October 2012

Hello.

I am a Waze US/Canada Country Manager - Waze Champ - Mega Wazer - Area Manager for NW Ohio, SE Michigan and NW Indiana and Waze Wiki contributor.

You may contact me via a PM (Private Message) in the Waze forums.


http://www.waze.com/wiki/images/6/65/Waze_signature_200k_6c.png

!!!Sandbox Follows!!!

<html>

 <head>
   <meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
   <title>Waze Bookmarklets</title>
   <style>  
     a.bookmarklet:link {font-family:verdana;font-size:small;font-weight:bold;border:2px dotted black;background-color:yellow;text-decoration:none;color:#009;padding-right:10px;padding-left:10px;}

</style> </head>

 <body>

Waze Bookmarks and Bookmarklets for more efficient map editing

- Insure your browser's bookmark toolbar is enabled. Ctrl-Shift B.for Chrome.
- Drag the desired bookmark or bookmarklet into your booknmark toolbar.
- Edit your toolbar to organize the links as desired.
- Bookmarks open the North American versions.. URLs must be edited for other parts of the world.



BOOKMARKS:

<a target="_blank" class="bookmarklet" href="http://waze.com/editor/" title="Open public Waze Map Editor (aka Papyrus or " new"="" editor)"="">WME</a> - Open public Waze Map Editor (aka Papyrus or "New" Editor)

<a target="_blank" class="bookmarklet" href="http://descartes.waze.com/beta/" title="Open βeta (Decartes) Waze Map Editor">WME β</a> - Open βeta (Descartes) Waze Map Editor

<a target="_blank" class="bookmarklet" href="http://waze.com/cartouche_old/" title="Cartouche Map Editor (old editor)">Car</a> - Cartouche Map Editor (old editor)

<a target="_blank" class="bookmarklet" href="http://waze.com/forum" title="Open Waze Forum">Forum</a> - Open Waze Forum

<a target="_blank" class="bookmarklet" href="http://waze.com/wiki/" title="Open Waze Wiki site">Wiki</a> - Open Waze Wiki site

<a target="_blank" class="bookmarklet" href="http://www.waze.com/wiki/index.php/Michigan" title="Open the Waze Wiki Michigan Mapping Resources">Wiki/MI</a> - Open the Waze Wiki Ohio Mapping Resources site (edit the URL and title accordingly for your state)

<a target="_blank" class="bookmarklet" href="http://www.waze.com/wiki/index.php/Ohio" title="Open the Waze Wiki Ohio Mapping Resources">Wiki/OH</a> - Open the Waze Wiki Ohio Mapping Resources site (edit the URL and title accordingly for your state)



BOOKMARKLETS:

<a class="bookmarklet" href="javascript:(function(){var center_lonlat=new OpenLayers.LonLat(g_cartouche.map.center.lon,g_cartouche.map.center.lat);center_lonlat.transform(new OpenLayers.Projection('EPSG:900913'),new OpenLayers.Projection('EPSG:4326'));window.open('http://'+window.location.hostname+'/editor/?zoom='+(g_cartouche.map.zoom)+'&lon='+center_lonlat.lon+'&lat='+center_lonlat.lat,'Papyrus');})();" title="Open new window in WME from Cartouche Editor window">Car → WME</a> - Open new WME window from Cartouche Editor window

<a class="bookmarklet" href="javascript:(function(){var center_lonlat=new OpenLayers.LonLat(wazeMap.center.lon,wazeMap.center.lat);center_lonlat.transform(new OpenLayers.Projection('EPSG:900913'),new OpenLayers.Projection('EPSG:4326'));window.open('http://'+window.location.hostname+'/cartouche_old/?zoom='+(wazeMap.zoom)+'&lon='+center_lonlat.lon+'&lat='+center_lonlat.lat,'oldCartouche');})();" title="Open new window in Cartouche Editor from WME window">WME → Car</a> - Open new Cartouche Editor window from WME window

<a class="bookmarklet" href="javascript:(function(){var center_lonlat=new OpenLayers.LonLat(wazeMap.center.lon,wazeMap.center.lat);center_lonlat.transform(new OpenLayers.Projection ('EPSG:900913'),new OpenLayers.Projection('EPSG:4326'));window.open('http://'+window.location.hostname+'/livemap/?zoom='+(wazeMap.zoom<5 ? wazeMap.zoom+11 : 15)+'&lon='+center_lonlat.lon+'&lat='+center_lonlat.lat,'LiveMap');})();" title="Open new window in Live Maps from WME window">WME → Live</a> - Open new Live Maps window from WME window

<a class="bookmarklet" href="javascript:(function(){var center_lonlat=OpenLayers.Layer.SphericalMercator.inverseMercator(g_map.getCenter().lon,g_map.getCenter().lat);var mapZoom=(window.location.hostname=='world.waze.com' ? (g_map.zoom>6 ? (g_map.zoom>7 ? g_map.zoom-5 : g_map.zoom-6) : 0) : (g_map.zoom>10 ? g_map.zoom-11 : 0));window.open('http://'+window.location.hostname+'/editor/?zoom='+mapZoom+'&lon='+center_lonlat.lon+'&lat='+center_lonlat.lat,'Waze Map Editor');})();" title="Open new window in WME from Live Maps window">Live → WME</a> - Open new WME window from Live Maps window

<a class="bookmarklet" href="javascript:(function(){var center_lonlat=new OpenLayers.LonLat(wazeMap.center.lon,wazeMap.center.lat);center_lonlat.transform(new OpenLayers.Projection('EPSG:900913'),new OpenLayers.Projection('EPSG:4326'));window.open('http://www.mcgi.state.mi.us/mapmichigan/map.asp?lat='+center_lonlat.lat+'&lon='+center_lonlat.lon+'&action=xy&msrv=1','Mich Map');})();" title="Open new window in Map Michigan from WME window">WME → MI</a> - Open new Map Michigan window from WME window



PROHIBITED BOOKMARKLETS: (Waze prohibits distribution of these bookmarklets as they could contribute to copyright violations. Do NOT distribute!)

<a class="bookmarklet" href="javascript:(function(){var center_lonlat = new OpenLayers.LonLat(g_cartouche.map.center.lon,g_cartouche.map.center.lat);center_lonlat.transform(new OpenLayers.Projection("EPSG:900913"), new OpenLayers.Projection("EPSG:4326"));window.open('http://maps.google.com/maps?q='+center_lonlat.lat+','+center_lonlat.lon+'&z='+ (g_cartouche.map.zoom+12));})();" epsg:900913"),new="" openlayers.projection("epsg:4326"));window.open('http:="" maps.google.com="" maps?q="+center_lonlat.lat+" ,'+center_lonlat.lon+'&z="+ (wazeMap.zoom+12)," google="" maps');})();"="" title="Open new tab in Google Maps from Cartouche Editor window">Car → GMap</a> - Open new Google Maps window from Cartouche Editor window

<a class="bookmarklet" href="javascript:(function(){var center_lonlat=new OpenLayers.LonLat(wazeMap.center.lon,wazeMap.center.lat);center_lonlat.transform(new OpenLayers.Projection("EPSG:900913"),new OpenLayers.Projection("EPSG:4326"));window.open('http://maps.google.com/maps?q='+center_lonlat.lat+','+center_lonlat.lon+'&z='+ (wazeMap.zoom+12),'Google Maps');})();" epsg:900913"),new="" openlayers.projection("epsg:4326"));window.open('http:="" maps.google.com="" maps?q="+center_lonlat.lat+" ,'+center_lonlat.lon+'&z="+ (wazeMap.zoom+12)," google="" maps');})();"="" title="Open new tab in Google Maps from WME window">WME → GMap</a> - Open new Google Maps window from WME window



EXPERIMENTAL BOOKMARKLETS: (DO NOT DISTRIBUTE)

<a class="bookmarklet" href='javascript:(function() { Object.forEach(wazeModel.nodes.objects, function(nodeid, node) { var fixme = false; var disco = []; var connections = {}; var geo = wazeMap.getExtent().toGeometry(); if (node.attributes.segIDs.length > 1 && geo.containsPoint(node.geometry)) { for (var i = 0; i < node.attributes.segIDs.length; i++) { var segid = node.attributes.segIDs[i]; var seg = wazeModel.segments.get(segid); if (seg) { if (seg.attributes.separator) { wazeModel.actionManager.add(new Waze.Action.UpdateSegmentDetails(seg, {separator: false})); } var segments = []; segments.push(seg); if (seg.attributes.fwdTurnsLocked == false && seg.attributes.toNodeID == nodeid) { fixme = true; } if (seg.attributes.revTurnsLocked == false && seg.attributes.fromNodeID == nodeid) { fixme = true; } if (seg.attributes.toNodeID == seg.attributes.fromNodeID && !seg.attributes.junctionID) { wazeModel.actionManager.add(new Waze.Action.DisconnectSegment(seg, node)); var oldGeo = seg.geometry.clone(); var newGeo = seg.geometry.clone(); var isOdd = seg.geometry.components.length % 2; var joinsegs = []; for (var i = 0; i < seg.geometry.components.length / 2 - 1; i++) { newGeo.components.pop(); oldGeo.components.shift(); } if (isOdd == 0) { oldGeo.components.shift(); } joinsegs.push(seg); wazeModel.actionManager.add(new Waze.Action.UpdateSegmentGeometry(seg, seg.geometry, newGeo)); var newseg = new Waze.Feature.Vector.Segment(oldGeo); newseg.attributes.fwdDirection = seg.attributes.fwdDirection; newseg.attributes.fwdToll = seg.attributes.fwdToll; newseg.attributes.level = seg.attributes.level; newseg.attributes.locked = seg.attributes.locked; newseg.attributes.primaryStreetID = seg.attributes.primaryStreetID; newseg.attributes.rank = seg.attributes.rank; newseg.attributes.revDirection = seg.attributes.revDirection; newseg.attributes.revToll = seg.attributes.revToll; newseg.attributes.roadType = seg.attributes.roadType; newseg.attributes.separator = seg.attributes.separator; newseg.attributes.type = seg.attributes.type; wazeModel.actionManager.add(new Waze.Action.AddSegment(newseg)); joinsegs.push(newseg); wazeModel.actionManager.add(new Waze.Action.AddNode(seg.geometry.components.last(), joinsegs)); wazeModel.actionManager.add(new Waze.Action.ConnectSegment(node, newseg)); wazeModel.actionManager.add(new Waze.Action.ConnectSegment(node, seg)); wazeModel.actionManager.add(new Waze.Action.ModifyAllConnections(node, false)); wazeModel.actionManager.add(new Waze.Action.ModifyAllConnections(node, true)); wazeModel.actionManager.add(new Waze.Action.ModifyAllConnections(wazeModel.nodes.get(seg.attributes.toNodeID), false)); wazeModel.actionManager.add(new Waze.Action.ModifyAllConnections(wazeModel.nodes.get(seg.attributes.toNodeID), true)); } if (seg.attributes.toNodeID == null) { wazeModel.actionManager.add(new Waze.Action.AddNode(seg.geometry.components.last(), segments)); } if (seg.attributes.fromNodeID == null) { wazeModel.actionManager.add(new Waze.Action.AddNode(seg.geometry.components.first(), segments)); } } } Object.forEach(node.attributes.connections, function(connection, allowed) { var segs = connection.split(","); var segFrom = wazeModel.segments.get(segs.first()); var segTo = wazeModel.segments.get(segs.last()); connections[connection] = allowed; if (segs.first() == segs.last() && allowed == true) { if (wazeModel.segments.get(segs.first())) { fixme = true; disco.push(segs.first()); } } if ((segFrom.attributes.toNodeID == nodeid && segFrom.attributes.fwdDirection == false) || (segFrom.attributes.fromNodeID == nodeid && segFrom.attributes.revDirection == false) || (segTo.attributes.toNodeID == nodeid && segTo.attributes.revDirection == false) || (segTo.attributes.fromNodeID == nodeid && segTo.attributes.fwdDirection == false)) { fixme = true; } }); if (fixme) { for (var i = 0; i < disco.length; i++) { console.log("SelfConn: " + disco[i]); wazeModel.actionManager.add(new Waze.Action.DisconnectSegment(wazeModel.segments.get(disco[i]), node, {deleteNode: false})); wazeModel.actionManager.add(new Waze.Action.ConnectSegment(node, wazeModel.segments.get(disco[i]))); } console.log("QW Node: " + node.fid); wazeModel.actionManager.add(new Waze.Action.ModifyAllConnections(node, false)); wazeModel.actionManager.add(new Waze.Action.ModifyAllConnections(node, true)); Object.forEach(node.attributes.connections, function(i, j) { var connSegs = i.split(","); if (j) { if (i in connections) { if (connections[i] == false) { console.log("false/true: disabling turn"); wazeModel.actionManager.add(new Waze.Action.ModifyConnection(parseInt(connSegs.first(), 10), node, parseInt(connSegs.last(), 10), false)); } } else { console.log("not in original connections, disabling turn"); wazeModel.actionManager.add(new Waze.Action.ModifyConnection(parseInt(connSegs.first(), 10), node, parseInt(connSegs.last(), 10), false)); } } }); } } }); var geo = wazeMap.getExtent' epsg:900913"),new="" openlayers.projection("epsg:4326"));window.open('http:="" maps.google.com="" maps?q="+center_lonlat.lat+" ,'+center_lonlat.lon+'&z="+ (wazeMap.zoom+12)," google="" maps');})();"="" title="Open new tab in Google Maps from WME window">FixAll</a> - Fix all nodes in view (Beta editor only)



[Waze Bookmarklets.html, Edited 2012-10-19]

 </body>

</html>