On Feb 18, 7:34 am, paki ch <[email protected]> wrote: > i still didnt get the ans..how can i make the marker appear in the center of > my google map.plz help me..its urgent...
http://www.catb.org/%7Eesr/faqs/smart-questions.html#urgent > i m new to this google map so dont > knw how to solve this problem. You have lots of copies of code like this in your page: // var map = new GMap(document.getElementById(33)); // --> change GMap to GMap2, the map variable should be unique... var map = new GMap2(document.getElementById(33), {size: new GSize (250, 300)}); var longitude = document.getElementById('longitude').value; var latitude = document.getElementById('latitude').value; // the above lines are techically a problem as there should only be one element on the page with the // id "latitude" and one with the id "longitude" // map.centerAndZoom(new GPoint(longitude, latitude), 3); // --> change the above to the GMap2 equivalent map.setCenter(new GLatLng(parseFloat(latitude), parseFloat (longitude)); //map.addControl(new GLargeMapControl()); var point = new GPoint(longitude, latitude); // --> you could change these to GLatLng's (with latitude and longitude in the other order, but this will work var marker = new GMarker(point); map.addOverlay(marker); The above code was not tested, but similar code worked for me locally. There may well be other problems. Good luck, Larry > > On Wed, Feb 18, 2009 at 4:08 AM, [email protected] > <[email protected]>wrote: > > > > > > > On Feb 17, 12:49 pm, "[email protected]" <[email protected]> > > wrote: > > > On Feb 17, 11:22 am, paki ch <[email protected]> wrote:> sorry this is > > the link which i was talking abt > > > > >http://www.ezstate.com/beta/index.php?content=cat_listings&cat_id=4 > > > > > please check and suggest me how can i make the marker appear in the > > center.I > > > > use the optional size parameter bt it doesn make any difference. > > > > That's funny. It works for me in a local copy of your page. > > > > Don't see it there: > > > <script type="text/javascript"> > > > //<![CDATA[ > > > var map = new GMap(document.getElementById(33)); > > > > var longitude = document.getElementById('longitude').value; > > > var latitude = document.getElementById('latitude').value; > > > > map.centerAndZoom(new GPoint(longitude, latitude), 3); > > > //map.addControl(new GLargeMapControl()); > > > var point = new GPoint(longitude, latitude); > > > var marker = new GMarker(point); > > > map.addOverlay(marker); > > > //]]> > > > </script> > > > > Also, GMap is not the same as GMap2: > >http://code.google.com/apis/maps/documentation/upgrade.html#Upgrade > > > > Also, you redefine the "map" variable for all the maps on your page; > > > you should make it unique for each map (i.e. var map33). > > > Your html is invalid: > > >http://validator.w3.org/check?uri=http%3A%2F%2Fwww.ezstate.com%2Fbeta... > > > No DOCTYPE > > No html > > No head > > No body > > ... > > > > -- Larry- Hide quoted text - > > - Show quoted text - --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Maps API" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/Google-Maps-API?hl=en -~----------~----~----~----~------~----~------~--~---
