Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Mapstraction: JavaScript Mapping Abstraction Library


Published on

An overview of using Mapstraction to access Google Maps, Yahoo Maps and more!

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Mapstraction: JavaScript Mapping Abstraction Library

  1. 1. Mapstraction JavaScript mapping abstraction library Adam DuVander
  2. 2. Google Maps! Yeah!
  3. 3. Yahoo Maps. Okay.
  4. 4. // Basic Google Map, with Marker point = new GLatLng(37.780764,-122.395592) map = new GMap2(document.getElementById("map-canvas")); map.setCenter(point, 15, G_NORMAL_MAP); marker = new GMarker(point, markerOptions); map.addOverlay(marker); // Basic Yahoo Map, with Marker var map = new YMap(document.getElementById("ymap")); map.drawZoomAndCenter("Portland, OR", 6); var myMarker = new YMarker("622 SE Grand Ave, Portland, OR"); map.addOverlay(myMarker);
  5. 5. 11 Maps in One! FreeEarth Google Map24 MapQuest Microsoft MultiMap OpenLayers OpenSpace OpenStreetMap ViaMichelin Yahoo
  6. 6. About me Portland Web Innovators First Wednesdays,
  7. 7. About me
  8. 8. Why Mapstraction?
  9. 12. Isn't Mapstraction a LCD library?
  10. 13. Not Really
  11. 17. Open Closed
  12. 18. switch (this.api) { case 'yahoo': var ypin = this.proprietary_marker; ypin.closeSmartWindow(); break; case 'google': var gpin = this.proprietary_marker; gpin.closeInfoWindow(); break; case 'microsoft': var pin = this.proprietary_marker;; break; ... }
  13. 19. More about Mapstraction (join the mailing list) Follow my book progress Thank you! @adamd