fixed small render node issue

This commit is contained in:
Connor Turland 2014-11-05 13:26:14 -05:00
parent 2bcead3900
commit 7193d2a386
3 changed files with 10 additions and 7 deletions

View file

@ -2478,6 +2478,7 @@ Extras.Classes.Navigation = new Class({
jQuery(document).trigger(Metamaps.JIT.events.zoom, [e]);
// END METAMAPS CODE
console.log('zooming');
},
onMouseDown: function(e, win, eventInfo) {
@ -7427,6 +7428,7 @@ Graph.Label.Native = new Class({
(end code)
*/
plotLabel: function(canvas, node, controller) {
/*
var ctx = canvas.getCtx();
var pos = node.pos.getc(true);
@ -7437,7 +7439,8 @@ Graph.Label.Native = new Class({
//START METAMAPS CODE
var arrayOfLabelLines = Metamaps.Util.splitLine(node.name,30).split('\n');
//var arrayOfLabelLines = Metamaps.Util.splitLine(node.name,30).split('\n');
var arrayOfLabelLines = ["something", "something"];
//render background
ctx.fillStyle = ctx.strokeStyle = Metamaps.Settings.colors.labels.background;
ctx.lineWidth = 2;
@ -7466,9 +7469,9 @@ Graph.Label.Native = new Class({
ctx.fill();
//ctx.stroke();
ctx.fillStyle = ctx.strokeStyle = node.getLabelData('color');
ctx.fillStyle = ctx.strokeStyle = node.getLabelData('color');*/
this.renderLabel(arrayOfLabelLines, canvas, node, controller);
//this.renderLabel(arrayOfLabelLines, canvas, node, controller);
// END METAMAPS CODE
// ORIGINAL CODE this.renderLabel(canvas, node, controller);
},

View file

@ -422,7 +422,7 @@ Metamaps.JIT = {
}
// if the topic has a link, draw a small image to indicate that
var hasLink = topic.get('link') !== "" && topic.get('link') !== null;
var hasLink = topic && topic.get('link') !== "" && topic.get('link') !== null;
var linkImage = Metamaps.JIT.topicMediaImage;
var linkImageLoaded = linkImage.complete ||
(typeof linkImage.naturalWidth !== "undefined" &&

View file

@ -1845,7 +1845,7 @@ Metamaps.Realtime = {
startActiveMap: function () {
var self = Metamaps.Realtime;
if (Metamaps.Active.Map) {
if (Metamaps.Active.Map && Metamaps.Active.Mapper) {
var commonsMap = Metamaps.Active.Map.get('permission') === 'commons';
var publicMap = Metamaps.Active.Map.get('permission') === 'public';
@ -3645,7 +3645,7 @@ Metamaps.Topic = {
if (!$.isEmptyObject(Metamaps.Visualize.mGraph.graph.nodes)) {
Metamaps.Visualize.mGraph.graph.addNode(newnode);
nodeOnViz = Metamaps.Visualize.mGraph.graph.getNode(newnode.id);
topic.set('node', nodeOnViz, {silent: true}); //
topic.set('node', nodeOnViz, {silent: true});
topic.updateNode(); // links the topic and the mapping to the node
nodeOnViz.setData("dim", 1, "start");
@ -3694,7 +3694,7 @@ Metamaps.Topic = {
} else {
Metamaps.Visualize.mGraph.loadJSON(newnode);
nodeOnViz = Metamaps.Visualize.mGraph.graph.getNode(newnode.id);
topic.set('node', nodeOnViz);
topic.set('node', nodeOnViz, {silent: true});
topic.updateNode(); // links the topic and the mapping to the node
nodeOnViz.setData("dim", 1, "start");