mirror of
https://github.com/Esri/offline-editor-js.git
synced 2025-12-15 15:20:05 +00:00
removed unused and unneeded code
This commit is contained in:
parent
221d790705
commit
b1726ba880
@ -1,65 +1,19 @@
|
||||
"use strict"
|
||||
|
||||
define([],function()
|
||||
define(["edit/editsStore"],function(editsStore)
|
||||
{
|
||||
return function OfflineUtils()
|
||||
{
|
||||
/**
|
||||
* Returns a date string of month/day/year hours:minutes:seconds
|
||||
* @returns {string}
|
||||
*/
|
||||
this.getDateMDYHMS = function(){
|
||||
var date = new Date();
|
||||
var hh = date.getHours();
|
||||
var mm = date.getMinutes();
|
||||
var ss = date.getSeconds();
|
||||
|
||||
hh = hh < 10 ? "0" + hh : hh;
|
||||
mm = mm < 10 ? "0" + mm : mm;
|
||||
ss = ss < 10 ? "0" + ss : ss;
|
||||
|
||||
var dateHMS = (date.getMonth()+1) + "/"+ date.getDate()
|
||||
+ "/" + date.getFullYear() + " "
|
||||
+ hh + ":"
|
||||
+ mm + ":"
|
||||
+ ss;
|
||||
|
||||
return dateHMS;
|
||||
}
|
||||
|
||||
/**
|
||||
* Measures the size of the graphic's geometry and attributes.
|
||||
* This is a very fast method that only provides a basic estimation.
|
||||
* @param graphic
|
||||
* @returns {number}
|
||||
*/
|
||||
// jabadia: probably won't be needed
|
||||
this.apprxGraphicSize = function(graphic) {
|
||||
var g = this._serializeGraphicUtil(graphic);
|
||||
|
||||
var g = editsStore._serialize(graphic);
|
||||
return ((g.length *2)/1024/1024).round(4);
|
||||
}
|
||||
|
||||
this._serializeGraphicUtil = function(/* Graphic */ graphic){
|
||||
var json = new this._jsonGraphicsObject();
|
||||
json.geometry = JSON.stringify(graphic.geometry)
|
||||
|
||||
if(graphic.hasOwnProperty("attributes")){
|
||||
if(graphic.attributes != null){
|
||||
var q = JSON.stringify(graphic.attributes);
|
||||
json.attributes = q;
|
||||
}
|
||||
}
|
||||
|
||||
return JSON.stringify(json);
|
||||
}
|
||||
|
||||
/**
|
||||
* Model for storing serialized graphics
|
||||
* @private
|
||||
*/
|
||||
this._jsonGraphicsObject = function(){
|
||||
this.geometry = null;
|
||||
this.attributes = null;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user