Guest User

Untitled

a guest
May 24th, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. Drimki.StreetviewMarker = {};
  2.  
  3. Drimki.StreetviewMarker.instance = (function(){
  4.  
  5. var StreetviewMarkerClass = Class.create({
  6. initialize: function(){
  7. },
  8. getIconParameters: function() {
  9. return {
  10. image: '/img/gmaps/streetview/Carto_V2.1__Vue_de_la_Rue_PegMan_petit.png',
  11. iconAnchor: new GPoint(0, 0),
  12. iconSize: new GSize(31, 31)
  13. };
  14. },
  15. getIcon: function() {
  16. // icon is always the same, using only one image instance
  17. if (!this.icon) {
  18. this.icon = new GIcon(this.getIconParameters());
  19. }
  20. return this.icon;
  21. },
  22. getMarker: function() {
  23. this.marker = new GMarker(this.getLocation(), this.getIcon());
  24. return this.marker;
  25. },
  26. setLocation: function(location) {
  27. this.location = location;
  28. },
  29. getLocation: function() {
  30. if (!this.location) {
  31. // default coordinates should be the center of the map
  32. this.location = app.map.getCenter();
  33. }
  34. return this.location;
  35. }
  36. });
  37.  
  38. var singleton = new StreetviewMarkerClass();
  39.  
  40. return singleton;
  41.  
  42. })();
Add Comment
Please, Sign In to add comment