<div>Chris,</div>
<div> </div>
<div>You remember that POI stuff we discussed? That is sort of the thing that I have to do. Basically I read the data and create a vector layer with the lines and then I create a marker layer. They are tied together with a change that Eric made proposed in the next release. The layerswitched event is what he customized.
</div>
<div><font color="#008000"><font size="2">// ***** Routes *****</font></font></div>
<p><font size="2">markerRouteLayer = <font color="#0000ff">new</font> OpenLayers.Layer.Markers(<font color="#800000">"Routes"</font>);</font></p>
<p><font size="2">vectorRouteLayer = <font color="#0000ff">new</font> OpenLayers.Layer.Vector(<font color="#800000">"RouteLines"</font>);</font></p>
<p><font size="2">markerRouteLayer.events.register(<font color="#800000">'layerswitched'</font>, vectorRouteLayer, <font color="#0000ff">function</font> (e) {</font></p>
<p><font size="2">vectorRouteLayer.setVisibility(markerRouteLayer.getVisibility());</font></p>
<p><font size="2">});</font></p>
<p><font size="2"></font></p>
<p><font size="2">vectorRouteLayer.displayInLayerSwitcher = <font color="#0000ff">false</font>;</font></p>
<p><font size="2">GetRouteItems(PassID);</font></p>
<p><font size="2">map.addLayer(vectorRouteLayer);</font></p>
<p><font size="2">map.addLayer(markerRouteLayer);</font></p>
<div><font size="2">----------------------------------------------------------- Ajax Calls or in my case .Net Webservice stuff</font></div>
<div> </div><font color="#0000ff">
<p><font size="2">var</font></p></font><font size="2"> startIconUrl = imageDirectory + <font color="#800000">"startpoint.gif"</font>;</font>
<p><font size="2"><font color="#0000ff">var</font> endIconUrl = imageDirectory + <font color="#800000">"endpoint.gif"</font>;</font></p>
<p><font size="2"></font></p>
<p><font size="2"><font color="#0000ff">for</font>(i = 0; i < result.length; i++) {</font></p>
<p><font size="2"><font color="#0000ff">var</font> pointList = [];</font></p>
<p><font size="2"><font color="#0000ff">for</font> (j = 0; j < result[i].LatitudeList.length; j++) {</font></p>
<p><font size="2"><font color="#0000ff">var</font> newPoint = <font color="#0000ff">new</font> OpenLayers.Geometry.Point(result[i].LongitudeList[j], result[i].LatitudeList[j]);</font></p>
<p><font size="2">pointList.push(newPoint);</font></p>
<p><font size="2"><font color="#0000ff">if</font> (result[i].RouteIconList[j] != <font color="#800000">""</font>) {</font></p>
<p><font size="2">markerRouteLayer.addMarker(getMyMarker(imageDirectory + <font color="#800000">"wpicons/"</font> + result[i].RouteIconList[j], result[i].LatitudeList[j], result[i].LongitudeList[j]));</font></p>
<p><font size="2">}</font></p>
<p><font size="2">}</font></p>
<p><font color="#008000"><font size="2">//add trail markers</font></font></p>
<p><font size="2">markerRouteLayer.addMarker(getMyMarker(startIconUrl, result[i].LatitudeList[0], result[i].LongitudeList[0]));</font></p>
<p><font size="2">markerRouteLayer.addMarker(getMyMarker(endIconUrl, result[i].LatitudeList[j-1], result[i].LongitudeList[j-1]));</font></p>
<p><font color="#008000"><font size="2">//add trail line</font></font></p>
<p><font size="2"><font color="#0000ff">var</font> lineFeature = <font color="#0000ff">new</font> OpenLayers.Feature.Vector(<font color="#0000ff">new</font> OpenLayers.Geometry.LineString(pointList),<font color="#800000">
""</font>,<font color="#800000">""</font>);</font></p>
<p><font size="2">vectorRouteLayer.addFeatures(lineFeature);</font></p>
<p><font size="2">}</font></p>
<div><font size="2">Hope this helps....</font></div>
<div>Linda Rawson<br> </div><br><br>
<div><span class="gmail_quote">On 9/6/07, <b class="gmail_sendername">Chris Hardin</b> <<a href="mailto:chrislhardin@gmail.com">chrislhardin@gmail.com</a>> wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Does anyone know a good way to generate a routing overlay with<br>mapserver? I want to send to coordinates to the server and generate a
<br>route to overlay on the map.<br>_______________________________________________<br>Users mailing list<br><a href="mailto:Users@openlayers.org">Users@openlayers.org</a><br><a href="http://openlayers.org/mailman/listinfo/users">
http://openlayers.org/mailman/listinfo/users</a><br></blockquote></div><br>