Skip to content
This repository has been archived by the owner on Sep 17, 2021. It is now read-only.

Commit

Permalink
added custom marker images.
Browse files Browse the repository at this point in the history
  • Loading branch information
phillipthelen committed Dec 22, 2012
1 parent 91c3d17 commit b61b491
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
Binary file added static/images/home.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 11 additions & 1 deletion templates/hardware/hardwareview.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,19 @@
});

{% if hardware.owner != user and user.get_profile.location != None %}

var image = new google.maps.MarkerImage(
'/static/images/home.png',
new google.maps.Size(32,37), // size of the image
new google.maps.Point(0,0), // origin, in this case top-left corner
new google.maps.Point(16, 37) // anchor, i.e. the point half-way along the bottom of the image
);


map.addMarker({
lat: {{user.get_profile.location.latitude}},
lng: {{user.get_profile.location.longitude}}
lng: {{user.get_profile.location.longitude}},
icon: image
});
{% endif %}
});
Expand Down
10 changes: 9 additions & 1 deletion templates/users/userprofile.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,17 @@
});

{% if userprofile != user and user.get_profile.location != None %}
var image = new google.maps.MarkerImage(
'/static/images/home.png',
new google.maps.Size(32,37), // size of the image
new google.maps.Point(0,0), // origin, in this case top-left corner
new google.maps.Point(16, 37) // anchor, i.e. the point half-way along the bottom of the image
);

map.addMarker({
lat: {{user.get_profile.location.latitude}},
lng: {{user.get_profile.location.longitude}}
lng: {{user.get_profile.location.longitude}},
icon: image
});
{% endif %}
});
Expand Down

0 comments on commit b61b491

Please sign in to comment.