On Aug 21, 1:09 pm, hassy33 <[email protected]> wrote: > I would like to add that when you go on my map you will see two > markers. > One of the is on Room#832 and the other one is supposed to be on the > Copy Center Room. > > The Room#832 marker is strangely at the right place, where as the Copy > Center Room marker is totally off and is pointing to another place > totally. > Thanks.
Don't call map.fromDivPixelToLatLng Just use the value of latlng (or overlaylatlng, the third parameter). -- Larry > > hk > > On Aug 21, 4:03 pm, hassy33 <[email protected]> wrote: > > > > > Hi all, > > > It would be great if someone could help me out with this. > > > I have a custommap which is a floor plan of the office. I was able to > > get around creating my custom map, creating the tiles for them and > > placing it properly on the map using the correct lattitude and > > longitudes from the world map. > > > Right now, my map works with using zoom levels from 12 to 18, and the > > zooming in and out seems to work properly. > > > I am at the point of creating markers, to map colleagues offices on > > the map. Basically my first step in this task would be to find the > > lattitude and longitudes coordinates on the map, and then use those > > coordinates to create a marker point, then finally add it on the map. > > > I read a lot across the internet, and on Mike Williams API tutorial > > (http://econym.org.uk/gmap/), and through the Google Maps group and > > documentation. > > > So I found a method that would respond to a click event on the map and > > returns lattitude and longitude coordinates. > > This is the method (which I took from the Google documentation) > > > GEvent.addListener(map,"click", function(overlay, latlng) { > > if (latlng) > > { > > var myHtml = "The GPoint value is: " + map.fromDivPixelToLatLng > > (latlng) + " at zoom level " + map.getZoom(); > > map.openInfoWindow(latlng, myHtml); > > } > > > }); > > > The method seems to respond fine, as when I click on the map, I do the > > the info window with the lattitude and longitude of that point where I > > clicked. > > > I used those coordinates to create a marker using the following code > > (which I also took from the Google documentation): > > > var point = new GLatLng(45.58269217674233,-73.75332096369334); > > var marker = createMarker(point,'Room 832') > > map.addOverlay(marker); > > > For some reason I do not get any marker showing on the map. I tried to > > map many different locations on the map, and in some instances I do > > see the marker but totally off the lattitude and longitude coordinates > > for which I mapped them to. I also realized that as the zoom level > > changes, the marker moves (down or up) based on the zoom level. As if > > the coordinates of the point change based on the zoom level, which I > > find really strange. > > > So I am suscipicious that either my lattitude and longitude method is > > not precise (but I dont think so, since the range seems reasonable), > > or that there is something missing in my code or something I am not > > doing right (which seems more the case for me). > > > Can anyone help me with this?? Would be greatly appreciated. > > > You can find my map at the following location: > > >http://www.linkkings.com/hkbica_test/custommap.htm > > > You will note that I have a GLog window at the bottom which indicates > > which tiles are showing up. This is only for debugging purposes so no > > need to entangle yourself there. > > > Thanks. > > > hk- 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 -~----------~----~----~----~------~----~------~--~---
