<br>Hello, I'm relatively new to OpenLayers and having a problem with a relatively basic setup...<br><br>I'm using the Google Base Maps and trying to add a point feature to the map at point -70.84480 and -53.00471. (The airport in Punta Arenas, Chile). When I add the point, the blue star appears at the correct longitude, but at an incorrect latitude. Furthermore, the point moves when I drag the map up or down, jumping to a different latitude when the mouse button is released. Additionally, when the map is dragged far enough to the right/east, the point disappears.<br>
<br>I've tried using point.transform of the point geometry and changing the projection on the vector layer, and been unable to fix this behavior. I'm sure I'm missing something relatively simple, but I'm new to this and after two days of digging around the documentation and examples, I'm not sure what it is. Any suggestions would be appreciated.<br>
<br>The code can be found at: <a href="http://128.177.27.207/display.html">http://128.177.27.207/display.html</a><br><br>or:<br><br><pre id="line11"> var layer_style = OpenLayers.Util.extend({}, <br> OpenLayers.Feature.Vector.style['default']);<br>
layer_style.fillOpacity = 0.2;<br> layer_style.graphicOpacity = 1;<br><br> var style_blue = OpenLayers.Util.extend({}, layer_style);<br> style_blue.strokeColor = "blue";<br>
style_blue.fillColor = "blue";<br> style_blue.graphicName = "star";<br> style_blue.pointRadius = 10;<br> style_blue.strokeWidth = 3;<br> style_blue.rotation = 45;<br>
style_blue.strokeLinecap = "butt";<br><br> var options = {<br> projection: new OpenLayers.Projection("EPSG:900913"),<br> units: "m",<br>
numZoomLevels: 18,<br> maxResolution: 'auto',<br> maxExtent: new OpenLayers.Bounds(-20037508, -20037508,<br> 20037508, 20037508.34),<br>
sphericalMercator: true<br> };<br><br> var map = new OpenLayers.Map('map', options);<br> <br> var google_physical = <br> new OpenLayers.Layer.Google("Google Physical", <br>
{type: G_PHYSICAL_MAP}); <br> var google_sattelite = <br> new OpenLayers.Layer.Google("Google Satellite",<br> {type: G_SATELLITE_MAP});<br>
var google_hybrid = <br> new OpenLayers.Layer.Google("Google Hybrid",<br> {type: G_HYBRID_MAP});<br><br> map.addLayers([google_sattelite, <br>
google_physical, google_hybrid]); <br><br> map.addControl(new OpenLayers.Control.LayerSwitcher());<br> map.addControl(new OpenLayers.Control.MousePosition());<br>
map.addControl(new OpenLayers.Control.KeyboardDefaults());<br> <br> map.setCenter(new OpenLayers.LonLat(-13200000, 4500000), 5);<br> map.zoomToMaxExtent();<br><br>
var vectorLayer = <br> new OpenLayers.Layer.Vector("Aircraft Location");<br> <br> var point = new OpenLayers.Geometry.Point(-70.84480, -53.00471);<br> <br> var feature = new OpenLayers.Feature.Vector(<br>
point,<br> null,<br> style_blue);<br><br> vectorLayer.addFeatures(feature);<br> map.addLayer(vectorLayer); <br></pre><br><br><br clear="all">
David Van Gilst<br>DC-8 Network Engineer<br>National Suborbital Education and Research Center<br>University of North Dakota<br>(701) 330-2978<br><a href="mailto:d.vangilst@nserc.und.edu">d.vangilst@nserc.und.edu</a><br>