Hi Marjie,<div><br></div><div>This is what I have so far: <a href="http://sandbox.mikepurvis.com/maps/clearpath/">http://sandbox.mikepurvis.com/maps/clearpath/</a></div><div><br></div><div>(doubleclick to create more waypoints)</div>

<div><br></div><div>Like I say, it&#39;s a real hack, especially this kind of stuff:</div><div><br></div><div><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; ">

        var lonlatProjected = map.getLonLatFromViewPortPx(e.xy);</blockquote><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; ">

        /*alert(&quot;You clicked near &quot; + lonlatProjected.lat + &quot; N, &quot; + lonlatProjected.lon + &quot; E&quot;);*/</blockquote><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; ">

                                  </blockquote><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; ">

        var point = new OpenLayers.Geometry.Point(lonlatProjected.lon, lonlatProjected.lat);</blockquote><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; ">

        var pointFeature = new OpenLayers.Feature.Vector(point, null, style_waypoint);</blockquote><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; ">

        vectorLayer.addFeatures([pointFeature]);</blockquote><div><br></div><div>If you re-enable the alert, you see that it&#39;s very clearly _not_ a true latitude and longitude coming out of the getLonLatFromViewPortPx—it&#39;s a coordinate pair in some other scheme that&#39;s been packaged into a LonLat.</div>

<div><br></div><div>Perhaps one of the gurus could help break this down a bit for me. Is this an expected behaviour, or did I do something wrong in the setup phase? My understanding so far is that Pixel is for x/y pairs representing screen coordinates, LonLat is for x/y pairs representing global coordinates, and Point is for unitless x/y pairs representing anything that needs to be transformed or otherwise manipulated. Is that reasonable, or am I still out to lunch on it?</div>

<div><br></div><div>Thanks,</div><div><br></div><div>Mike</div></div><div><br></div><div><br><div class="gmail_quote">On Wed, May 5, 2010 at 12:19 AM, Marjie Anderson <span dir="ltr">&lt;<a href="mailto:marjiea1@gmail.com">marjiea1@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">








<div lang="EN-US" link="blue" vlink="purple">

<div>

<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">I would love to see an example of how you got this working in
code.  </span></p>

<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> </span></p>

<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">I  am having problems with hand parsing a kml file to pull
out the zoom box points and use them for bounds, pull out the marker point and
use that for the lonlat, and then letting the automatic kml loader load the
linestrings in the kml file that show all the points hooked together of where
my vehicle has been.  I can get it working without the spherical mercator
(and the markers not in the right place on the commercial layers), but once I
follow the directions for mercator using the forwardMercator calls: </span></p>

<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> </span></p>

<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">marker = new OpenLayers.Marker(OpenLayers.Layer.SphericalMercator.forwardMercator(lon,
lat));</span></p>

<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> </span></p>

<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">I get neither markers nor linestrings.</span></p>

<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> </span></p>

<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">I am unable to request help here for this issue as I cannot get
the non-mercator version to run on my current server space, only on my
development laptop.  </span></p>

<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> </span></p>

<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">Marjie</span></p>

<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> </span></p>

<div>

<div>

<p class="MsoNormal"><b><span style="font-size:10.0pt;color:#1F497D"> </span></b></p>

<p class="MsoNormal"><b><span style="font-size:10.0pt;color:#1F497D"> </span></b></p>

<p class="MsoNormal"><b><span style="font-size:10.0pt;color:#1F497D">“</span></b>Okay, yes, I have now got this working, but
it&#39;s been extremely painful. I can share my code for others if it would be
helpful to do so, but I feel certain that there must be a better way. It feels
extremely hacky to be constantly loading lat/lon pairs into Point objects, just
to &quot;transform&quot; them to the map coordinates. (Which, of course, the
map methods still refer to and interact with as LonLat objects, even the
contents are clearly not latitudes and longitudes, but another coordinate
system altogether.)</p>

</div>

<div>

<p class="MsoNormal"> </p>

</div>

<div>

<p class="MsoNormal">Seems like if I pass it LonLat objects, it just know to do
the right thing, as Google does.<span style="color:#1F497D">”</span></p>

</div>

</div>

</div>

</div>


</blockquote></div><br><br clear="all"><br>-- <br><a href="http://uwmike.com">http://uwmike.com</a><br>
</div>