Use VML to create reusable graphics

I want to create a small graphic in VML and have that graphic appear several times on a web page but without having to send the VML defintion each time.  I am really concerned about download times, ideally I would like to send the VML definition of the graphic once and then reference that definition with offsets the rest of the time.
LVL 2
macgreAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

M256Commented:
Hi macgre,

You are of course aware that VML is only for IE.  I assume you know what browser your audience will be using?

Matthew
0
M256Commented:
If you really want to use VML, here is a link that should get you started:
http://webfx.eae.net/dhtml/VMLClock/clock.html

Relevant section:
Reusing VML
There are a lot of ways to reuse your VML images. One is to set the src attribute for the xml tag. Another way is to insert it through a scriptlet. When you need to do scripting this is much better because you can remove all the scripting from the current page.


To see the scriptlet method in action, copy and paste this code to your HTML document:
<object type="text/x-scriptlet" data="http://webfx.eae.net/dhtml/VMLClock/clockScriptlet.html"
style="width: 200px; height: 200px;"></object>

Viola!  Instant VML!

Matthew
0
macgreAuthor Commented:
I would like to avoid scripting if at all possible.

More practical info on what it is I am trying to do.

I want to build a map of a rural area and display roads, houses and other major features whose locations are stored on a database (so that ANY rural area can be displayed once it is entered into the database).  But I don't just want to mark each house with simple X or square, I want it to look good.  I plan to use JSP to build each map based on parameters.

I was hoping I could send the VML commands to draw a house once identify it as an object and then send a command to draw all the other house objects at different locations.  In VML is there something like v:draw objectId="house; top=Y; left=X" where the objectId identifies the VML commands previously sent that actually draw a house?

Remember I only want to send the actual drawing of the house once, and then be able to reference it as many times as I like.

My own research lead me to consider shapetypes but I am not sure if they will do what I want, I suspect that each usage of a shape type actually loads the entire shape again, not what I want.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

M256Commented:
Can you post a link to your VML files so I can play around with them?

Matthew
0
M256Commented:
0
macgreAuthor Commented:
I don't have any VML files to show yet, but the VMLFrame link you provided seems interesting, I will try it on my own to see if it meets my needs.  I'll get back to you by Monday OK?
0
mis_understoodCommented:
Why not go towards SVG. atleast it can be view in other browsers and not just IE. (of course, you need to have the SVG plug in before you can view it, which is freely downloadable)

http://www.learnsvg.com/
http://www.w3schools.com/svg/default.asp

Hope this helps.

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
macgreAuthor Commented:
I actually plan to use SVG as well, on the home page you would set certain options or I would figure out a way to autodetect if the SVG plugin was present.  The Java code would then take the raw data and apply either VML or SVG as required to produce output the client browser supported.  Now since IE is so common and I didn't want to hassle people with "you must get this plugin first" I decided I would do both.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
HTML

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.