27 #include "../../../../geometry/MultiLineString.h" 28 #include "../../common/Utils.h" 35 if(!args.IsConstructCall())
36 return ::v8::ThrowException(::v8::String::New(
"In order to create a MultiLineString you need to call its constructor like: var mygc = new TeMultiLineString(2, TE_OGC_MULTILINESTRING, 4326)."));
38 if(args.Holder().IsEmpty())
39 return ::v8::ThrowException(::v8::String::New(
"MultiLineString constructor must use object notation!"));
41 if((args.Length() != 3) ||
42 args[0].IsEmpty() || !args[0]->IsInt32() ||
43 args[1].IsEmpty() || !args[1]->IsInt32() ||
44 args[2].IsEmpty() || !args[2]->IsInt32())
45 return ::v8::ThrowException(::v8::String::New(
"Missing parameter or wrong parameter type in MultiLineString constructor method!!"));
47 int ngeom = args[0]->Int32Value();
48 int geomType = args[1]->Int32Value();
49 int srid = args[2]->ToInt32()->Int32Value();
51 std::auto_ptr<te::gm::MultiLineString> g(
new te::gm::MultiLineString(ngeom, static_cast<te::gm::GeomType>(geomType), srid));
66 global->Set(::v8::String::New(
"TeMultiLineString"), jsgc->GetFunction());
76 ::v8::Local<::v8::FunctionTemplate> result = ::v8::FunctionTemplate::New();
77 result->Inherit(mcurveTpl);
::v8::Local<::v8::Object > Make(T *obj, TF tfunc, const bool isOwner)
It creates a new JavaScript object from a C++ object (obj).
::v8::Handle<::v8::Value > MultiLineString_Constructor(const ::v8::Arguments &args)
::v8::Persistent<::v8::FunctionTemplate > & GetMultiCurveTemplate()
It returns a reference to the persistent template of a MultiCurve object.
void RegisterMultiLineString(::v8::Local<::v8::Object > &global)
It register the MultiLineString class.
MultiLineString is a MultiCurve whose elements are LineStrings.
static::v8::Persistent<::v8::FunctionTemplate > sg_mline_template
::v8::Persistent<::v8::FunctionTemplate > & GetMultiLineStringTemplate()
It returns a reference to the persistent template of a MultiLineString object.