Hi Harish, <br><br>If you remove the line &quot;map.addLayer(layer);&quot; in your script, then it works. <br><br>You should also put your map options to Spherical Mercator (EPSG: 900913): <br><br>    var options = {
<br>        projection: new OpenLayers.Projection(&quot;EPSG:900913&quot;),<br>        displayProjection: new OpenLayers.Projection(&quot;EPSG:4326&quot;),<br>        units: &quot;m&quot;,<br>        numZoomLevels: 18,<br>
        maxResolution: 156543.0339,<br>        maxExtent: new OpenLayers.Bounds(-20037508, -20037508, 20037508, 20037508.34)
<br>        };<br><br><br>and put your google layers to sphericalMercator:true: <br><br>var gphy = new OpenLayers.Layer.Google( &quot;Google Physical&quot;, {type: G_PHYSICAL_MAP,&#39;sphericalMercator&#39;: true} );<br>
<br><br>and then translate your coordinates in WGS84 (EPSG:4326) in EPSG:900913 like you have already done by: <br><br>center.transform(proj, map.getProjectionObject());<div></div><br>It is better to work in SphericalMercator (EPSG: 900913) with Google layers. <br>
<br><br><br>Julien<br><br><br><div class="gmail_quote">On Fri, Jan 22, 2010 at 8:57 PM, Harish Chandran <span dir="ltr">&lt;<a href="mailto:harishchandran19@gmail.com">harishchandran19@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hello everyone. This is my first post and its about a problem I can&#39;t figure out. I wanted to make a google map based interface
with a marker pointing specific locations. It all went well till I loaded the
page. I can see my map.but I can&#39;t see the marker. It is supposed to
point at the map center.Here is the code:<br>
<br>##############################<div>###################################################################################################################<br>         <br>&lt;html xmlns=&quot;<a href="http://www.w3.org/1999/xhtml" target="_blank">http://www.w3.org/1999/xhtml</a>&quot;&gt;<br>


&lt;head&gt;<br>&lt;title&gt;User Interface&lt;/title&gt;<br><br>&lt;link rel=&quot;stylesheet&quot; href=&quot;file:///C:/Documents%20and%20Settings/N-compass/Desktop/UI/basicstyle.css&quot; /&gt;  <br><br>&lt;link rel=&quot;stylesheet&quot; href=&quot;file:///C:/Documents%20and%20Settings/N-compass/Desktop/UI/google.css&quot; type=&quot;text/css&quot; /&gt;<br>


<br>&lt;link rel=&quot;stylesheet&quot; href=&quot;file:///C:/Documents%20and%20Settings/N-compass/Desktop/UI/style.css&quot; type=&quot;text/css&quot; /&gt;<br><br>&lt;script src=&#39;<a href="http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAjpkAC9ePGem0lIq5XcMiuhR_wWLPFku8Ix9i2SXYRVK3e45q1BQUd_beF8dtzKET_EteAjPdGDwqpQ" target="_blank">http://maps.google.com/maps?file=api&amp;amp;v=2&amp;amp;key=ABQIAAAAjpkAC9ePGem0lIq5XcMiuhR_wWLPFku8Ix9i2SXYRVK3e45q1BQUd_beF8dtzKET_EteAjPdGDwqpQ</a>&#39;&gt;&lt;/script&gt;<br>


&lt;script src=&quot;<a href="http://openlayers.org/dev/OpenLayers.js" target="_blank">http://openlayers.org/dev/OpenLayers.js</a>&quot;&gt;&lt;/script&gt;                            <br>&lt;script type=&quot;text/javascript&quot;&gt;<br>


<br>    var map;<br>    var size, icon;<br>        <br>    function init(){<br> <br>        map = new OpenLayers.Map(&#39;map&#39;);<br>        <br>   <br>        var gphy = new OpenLayers.Layer.Google(<br>            &quot;Google Physical&quot;,<br>


            {type: G_PHYSICAL_MAP}<br>        );<br>        var gmap = new OpenLayers.Layer.Google(<br>            &quot;Google Streets&quot;, // the default<br>            {numZoomLevels: 20}<br>        );<br>        var ghyb = new OpenLayers.Layer.Google(<br>


            &quot;Google Hybrid&quot;,<br>            {type: G_HYBRID_MAP, numZoomLevels: 20}<br>        );<br>        var gsat = new OpenLayers.Layer.Google(<br>            &quot;Google Satellite&quot;,<br>            {type: G_SATELLITE_MAP, numZoomLevels: 20}<br>


        );<br>            <br>        map.addLayers([gphy, gmap, ghyb, gsat]);<br>     <br>        <br>    <br>    var proj = new OpenLayers.Projection(&quot;EPSG:4326&quot;);<br>    var center = new OpenLayers.LonLat(72.856178,19.017656);<br>


    center.transform(proj, map.getProjectionObject());<br>   <br>    map.setCenter(center,11);<br>                    <br>    map.addLayer(layer);<br>    var markers = new OpenLayers.Layer.Markers( &quot;Markers&quot; );<br>


    map.addLayer(markers);<br><br>    size = new OpenLayers.Size(15,15);<br>    calculateOffset = function(size) {return new OpenLayers.Pixel(-(size.w/2), -size.h);};<br>    icon = new OpenLayers.Icon(&#39;file:///C:/Documents%20and%20Settings/N-compass/Desktop/UI/marker.png&#39;,size, null, calculateOffset);<br>


    <br>    markers.addMarker(new OpenLayers.Marker(center,icon));<br>    <br>    map.addControl(new OpenLayers.Control.LayerSwitcher());<br>        <br>    }<br>        <br>&lt;/script&gt;<br>&lt;/head&gt;<br>      <br>

    &lt;body onload=&quot;init()&quot;&gt;<br>
        &lt;h1 id=&quot;title&quot;&gt;User Interface&lt;/h1&gt;<br>        <br>        &lt;div id=&quot;tags&quot;&gt;<br>        &lt;/div&gt;<br><br>        &lt;p id=&quot;shortdesc&quot;&gt;<br>            This project is still not over<br>


        &lt;/p&gt;<br><br>        &lt;a style=&quot;float:right&quot; href=&quot;&quot; id=&quot;permalink&quot;&gt;Permalink&lt;/a&gt;<br>        <br>        &lt;div id=&quot;map&quot; class=&quot;smallmap&quot; onclick=&quot;co-ordinate()&quot;&gt;&lt;/div&gt;<br>


<br>        &lt;div id=&quot;docs&quot;&gt;&lt;/div&gt;<br>    &lt;/body&gt;<br>&lt;/html&gt;<br>########################################################################################################################################<br>


The path to css and icon files have been changed to point to files in
my local directory. But they are the same files used in the openlayers
examples.<br><br>I know I am missing something very silly, can&#39;t figure it out. Any ideas?<br>
</div>
<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" target="_blank">http://openlayers.org/mailman/listinfo/users</a><br>
<br></blockquote></div><br>