Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I want to go from http://www.zolnai.ca/WMS/whereintheworldV2.htm to http://www.zolnai.ca/WMS/whereintheworldV3.htm I went through Gmaps API documentation on code.google.com And added the changes that I could find But I cannot get the V3.htm to display anything. Comments or suggestions please? Thanks in advance, A.

share|improve this question
    
v3 is a complete re-write to include mobile applications, you have v2 references in your code - look at this v3 script and compare the differences - code.google.com/p/gmaps-samples-v3/source/browse/trunk/… –  Mapperz Mar 13 '12 at 13:26
    
thx, and I tried to reflect that in my page suffixed v3, but I cannot get anything to show up but header, neither map not list –  Andrew Zolnai Mar 18 '12 at 12:32
add comment

1 Answer

In http://www.zolnai.ca/WMS/whereintheworldV3.htm you are missing the following:

  1. Proper reference to the google maps api library. From v3 there is no need for an api key so the reference would look like this:

    <script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false"></script>
    
  2. There is no need for "new google.maps.Icon". You can simply use gicons["pink"]="0pink_Marker.PNG";

  3. "new google.maps.Marker(point, gicons[icontype]);" is completely wrong syntax in v3. The right way of defining your marker would be: "new google.maps.Marker({position:point, icons:gicons[icontype]});" That is because in v3, the marker object requires a list of options in a javascript object literal, which in your case is: {position:point,icon:gicons[icontype]}

I am watching the code right now but it seems to me your code is a perfect mixture ofthe two versions. I recommend you checking the v3 api and picking it up!

share|improve this answer
    
thx for that! I looked for 2-to-3 change-list in vain, so I picked some up and missed some - indeed it is a "perfect mixture" until I ferret out all the v.3 diffs and get rid of the v.2 syntax - ul also look up the new G-api page. –  Andrew Zolnai Mar 24 '12 at 10:22
    
Anyways, if you need help with any v3 stuff, just let me know, I'll be happy to help! :) –  Tamas Mar 24 '12 at 15:11
    
OK thx, do you know if a comparison table exists between v.2 & 3? As you can tell I ferreted out a few and you added more, but that doesn't cover all of them... ergo the v.2+3 mix you observe :-) Mapperz pointed me to a stock v.3 template so I almost considered rewriting the blessed thing, but so far I prefer to simply convert it - I think the structure is sound, only the syntax has changed, and I cannot find a dictionary! –  Andrew Zolnai Mar 25 '12 at 16:29
    
Andrew, Have a look at this link, I think it will help you: mymonkeydo.com/converting-google-maps-v2-to-v3 or developers.google.com/maps/documentation/javascript/reference –  Tamas Mar 26 '12 at 17:44
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.