New Creating 3D Buildings Alongside Google Maps


Update: John Dyer has instantly posted a full tutorial explaining how he created 3d buildings on the DTS campus map. John's method is a lot to a greater extent than elegant than mine.


I had ane of those 'I want I'd idea of that' moments this calendar week when I saw the awesome DTS Dallas Theological Seminary campus map. The map uses polygons in addition to the Google Maps 45° Imagery sentiment to practise the impression of 3d buildings on Google Maps.

Today I had a piddling play alongside the Google Maps API to run into if I could reproduce the effect. The final result is this piddling post for about clues every bit to their solution).

In center I exactly practise 4 dissimilar edifice polygons, ane for each heading inwards the 45° Imagery view. So when the user rotates the map solely the right edifice polygon is displayed on the map. To arrive at this yous bring to usage getHeading() alongside an lawsuit listener to honor when the map sentiment has been changed.

My solution is to bring 4 dissimilar edifice polygons in addition to thus practise an if...else contestation to charge the right edifice polygon. Here's the of import usage of the code: 

       if  (heading == 0)  {
       buildingOne.setMap(map);
       buildingTwo.setMap(null);
       buildingThree.setMap(null);
       buildingFour.setMap(null);
       }
     
       else if  (heading == 90) {
       buildingOne.setMap(null);
       buildingTwo.setMap(map);
       buildingThree.setMap(null);
       buildingFour.setMap(null);
       }
     
       else if  (heading == 180) {
       buildingOne.setMap(null);
       buildingTwo.setMap(null);
       buildingThree.setMap(map);
       buildingFour.setMap(null);
       }
     
       else if  (heading == 270) {
       buildingOne.setMap(null);
       buildingTwo.setMap(null);
       buildingThree.setMap(null);
       buildingFour.setMap(map);
       }

0 Response to "New Creating 3D Buildings Alongside Google Maps"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel