Ti.SvgView icon indicating copy to clipboard operation
Ti.SvgView copied to clipboard

Create SVG from remote

Open alvesl opened this issue 10 years ago • 10 comments

Hello! I've been trying to manually download a SVG to local storage and open it but I always get

[ERROR] :  The application has crashed with an uncaught exception 'NSInternalInconsistencyException'.
[ERROR] :  Reason:
[ERROR] :  Invalid parameter not satisfying: newSource != nil

I assume the module is unable to find the file. I've tried loading it (after writing to local) with nativePath, and also with resolve(). Can you point me on a direction here? I saw that the original SVGKit module allows creation from both remote and also from memory, this could be a way out too.

Thanks for all the help!

alvesl avatar Nov 17 '15 20:11 alvesl

Please see the demo app at : https://github.com/GeraudBourdin/Ti.SvgView-TestApp There is a complete sample on how to use it. Svg files needs to be on the /app/assets directory.

GeraudBourdin avatar Nov 19 '15 17:11 GeraudBourdin

Hello! Thanks for the answer and for the help! Yes, I've been able to use it correctly if I place my SVGs in the /assets directory. Although that works, I need to be able to load SVGs dynamically, from a remote url, as an example, I would want to be able to download and load this SVG: https://upload.wikimedia.org/wikipedia/commons/d/d8/Compass_card_(de).svg

I saw that the SVGKit (for iOS) has the ability to load SVG's from a remote website, or even from memory (after downloading the SVG). If none of those optios are possible, why is it that I cannot load an asset from the appData directory? Thanks

alvesl avatar Nov 19 '15 21:11 alvesl

@GeraudBourdin can you implement ability to load from string, blob source for both platforms? It will be sumptuously =)

falkolab avatar Nov 20 '15 08:11 falkolab

+1 - being able to load a remote resource would fantastic! What can we do to help?

DaKaZ avatar Nov 23 '15 15:11 DaKaZ

@alvesl : yes SVGKit can do that, but not in the android version. That's why i didn't included it, as you can do it with JS code. I'll have a look at it as soon as i have enough time :) @DaKaZ : you could send pull request ! :)

GeraudBourdin avatar Nov 25 '15 14:11 GeraudBourdin

Dear all, Any successful attempt in loading a remote SVG file?

focussing avatar Mar 28 '17 11:03 focussing

@focussing https://github.com/falkolab/Ti.SvgView/commit/56a04d74783f78690393312b77429a92fb071b0c

falkolab avatar Mar 28 '17 11:03 falkolab

@falkolab thanks, I already saw that and tried to contact you via Twitter :) Isn't this already waiting for @GeraudBourdin to merge that with the main stream? And I also need an iOS solution... My app supports both Android and iOS

focussing avatar Mar 28 '17 11:03 focussing

Sorry, I have not so mach expirience in iOS. Do you try https://github.com/falkolab/Ti.SvgView/releases ? I do not remember is it work for iOS as is.

falkolab avatar Mar 28 '17 15:03 falkolab

Yep I checked that. The release you made to enable blob/url etc as source for SVG file, is there a distribution also?

Best regards, Mit freundlichen Grüßen, Met vriendelijke groet, Raymond Verbruggen

FOCUSSING B.V. Mispel 8 7621 WB Borne Netherlands +31 6 250 500 69 [email protected] mailto:[email protected] www.focussing.nl http://www.focussing.nl/

Op 28 mrt. 2017, om 17:01 heeft Andrey Tkachenko [email protected] het volgende geschreven:

Sorry, I have not so mach expirience in iOS. Do you try https://github.com/falkolab/Ti.SvgView/releases https://github.com/falkolab/Ti.SvgView/releases ? I do not remember is it work for iOS as is.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/GeraudBourdin/Ti.SvgView/issues/9#issuecomment-289798811, or mute the thread https://github.com/notifications/unsubscribe-auth/AZf2GP6dJGDIG11PEWZCp8g5FiijcewRks5rqSDKgaJpZM4GkLoh.

focussing avatar Mar 29 '17 06:03 focussing