kopia lustrzana https://github.com/FacilMap/facilmap
Added different marker styles
rodzic
163a8e3e52
commit
5d79ef2ec3
Plik binarny nie jest wyświetlany.
Po Szerokość: | Wysokość: | Rozmiar: 758 B |
Plik binarny nie jest wyświetlany.
Po Szerokość: | Wysokość: | Rozmiar: 703 B |
Plik binarny nie jest wyświetlany.
Po Szerokość: | Wysokość: | Rozmiar: 753 B |
Plik binarny nie jest wyświetlany.
Po Szerokość: | Wysokość: | Rozmiar: 601 B |
|
@ -82,6 +82,11 @@
|
|||
$scope.onMove();
|
||||
});
|
||||
|
||||
$scope.$watch("currentMarker.style", function() {
|
||||
if($scope.currentMarker != null)
|
||||
fp.addMarker($scope.currentMarker);
|
||||
});
|
||||
|
||||
fp.onMoveEnd = function(bbox) {
|
||||
socket.emit("updateBbox", bbox);
|
||||
};
|
||||
|
@ -139,7 +144,7 @@
|
|||
$scope.$apply(function() {
|
||||
$scope.closeMessage(message);
|
||||
|
||||
socket.emit("addMarker", { position: { lon: pos.lon, lat: pos.lat } }, function(err, marker) {
|
||||
socket.emit("addMarker", { position: { lon: pos.lon, lat: pos.lat }, style: 'red' }, function(err, marker) {
|
||||
if(err)
|
||||
return $scope.showMessage("error", err);
|
||||
|
||||
|
|
|
@ -140,7 +140,9 @@ var FacilPad = {
|
|||
fp.addMarker = function(marker) {
|
||||
fp.deleteMarker(marker);
|
||||
|
||||
var markerObj = fp.layerMarkers.createMarker(new OpenLayers.LonLat(marker.position.lon, marker.position.lat));
|
||||
var icon = new OpenLayers.Icon("img/marker-"+marker.style+".png", new OpenLayers.Size(21,25), new OpenLayers.Pixel(-9, -25));
|
||||
|
||||
var markerObj = fp.layerMarkers.createMarker(new OpenLayers.LonLat(marker.position.lon, marker.position.lat), null, null, icon);
|
||||
markerObj.events.register("click", markerObj, function(e) {
|
||||
fp.onClickMarker(marker);
|
||||
});
|
||||
|
|
|
@ -74,6 +74,14 @@
|
|||
<dt><label for="edit-marker-name">Name</label></dt>
|
||||
<dd><input id="edit-marker-name" ng-model="currentMarker.name" /></dd>
|
||||
|
||||
<dt><label for="edit-marker-style">Style</label></dt>
|
||||
<dd><select id="edit-marker-style" ng-model="currentMarker.style">
|
||||
<option value="red">Red</option>
|
||||
<option value="green">Green</option>
|
||||
<option value="blue">Blue</option>
|
||||
<option value="gold">Yellow</option>
|
||||
</select></dd>
|
||||
|
||||
<dt><label for="edit-marker-description">Description</label></dt>
|
||||
<dd><textarea id="edit-marker-description" ng-model="currentMarker.description"></textarea></dd>
|
||||
</dl>
|
||||
|
|
|
@ -22,7 +22,7 @@ var markerSchema = mongoose.Schema({
|
|||
position : positionType,
|
||||
name : String,
|
||||
description : String,
|
||||
symbol : String
|
||||
style : String
|
||||
});
|
||||
|
||||
var lineSchema = mongoose.Schema({
|
||||
|
|
Ładowanie…
Reference in New Issue