I am generating SVGs on client side at runtime so I want to use it as PictureMarkerSymbols.
PictureMarkerSymbols takes the URL property of SVG to draw SVG symbol, Is there any other way to create SVG based PictureMarkerSymbols like to create it from:
1. Raw SVG tags
<svg> <rect x='0', y ='0', width='100', height='100' /> </svg>
or
2. Making use of Dojo GFX like
Vector Graphics with Dojo's GFX - Dojo Toolkit Tutorial
// Create a rectangle var rectangle = surface.createRect({ x: 100, y: 50, width: 200, height: 100 }) .setStroke("yellow"); gfxFx.animateStroke({ shape: rectangle, duration: 500, color: { start: "yellow", end: "pink" }, width: { end: 15 }, join: { values: ["miter", "bevel", "round"] } });
Dojo is being used by ESRI so it should support Dojo GFX
Any help would be very much appreciated.
Thanks
Abdul,
Have you seen this sample? SVG and CSS using D3 | ArcGIS API for JavaScript
Yes I have seen it.
Sorry for the dumb question but it only renders circles on map. How can I make it work with SVG tags please.
Abdul,
OK, I can not find an example of using a raw SVG as input. If you can obtain the SVG path string then you can use the Symbol.setPath method. If you have some standard SVGs that you use then you can use this website to get the paths for those SVGs
I have came across Raphael and SnapSVG.
Thanks for the reply.