Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Drimki.StreetviewMarker = {};
- Drimki.StreetviewMarker.instance = (function(){
- var StreetviewMarkerClass = Class.create({
- initialize: function(){
- },
- getIconParameters: function() {
- return {
- image: '/img/gmaps/streetview/Carto_V2.1__Vue_de_la_Rue_PegMan_petit.png',
- iconAnchor: new GPoint(0, 0),
- iconSize: new GSize(31, 31)
- };
- },
- getIcon: function() {
- // icon is always the same, using only one image instance
- if (!this.icon) {
- this.icon = new GIcon(this.getIconParameters());
- }
- return this.icon;
- },
- getMarker: function() {
- this.marker = new GMarker(this.getLocation(), this.getIcon());
- return this.marker;
- },
- setLocation: function(location) {
- this.location = location;
- },
- getLocation: function() {
- if (!this.location) {
- // default coordinates should be the center of the map
- this.location = app.map.getCenter();
- }
- return this.location;
- }
- });
- var singleton = new StreetviewMarkerClass();
- return singleton;
- })();
Add Comment
Please, Sign In to add comment