Custom Infobox in BingMap WPF Control
im trying create custom bingmap pushpin, should somthing
problem cannot shape "sticking out" indicate position.
have tried but, trainagle whithout sticking corner
[1]: http://i.stack.imgur.com/p45ux.png
problem cannot shape "sticking out" indicate position.
have tried but, trainagle whithout sticking corner
<controltemplate x:key="mycustompintemplate1" targettype="m:pushpin"> <grid x:name="contentgrid" horizontalalignment="left" verticalalignment="center" > <canvas x:name="contentpopup" visibility="visible"> <rectangle x:name="contentpopuprectangle" fill="aliceblue" opacity="0.7" canvas.left="0" strokethickness="2" stroke="wheat" canvas.top="0" height="50" width="122" radiusx="5" radiusy="5" /> <stackpanel canvas.left="10" canvas.top="5"> <contentpresenter horizontalalignment="center" verticalalignment="center" content="{templatebinding content}" margin="0" textblock.fontfamily="segoe ui" textblock.fontsize="9" textblock.foreground="red"> </contentpresenter> </stackpanel> </canvas> </grid> </controltemplate>
[1]: http://i.stack.imgur.com/p45ux.png
i'm assuming want custom infobox/popup , question has nothing polyline class. here style use create similar infobox/pupup using tooltips:
<style x:key="custominfoboxstyle" targettype="tooltip"> <setter property="overridesdefaultstyle" value="true" /> <setter property="verticaloffset" value="15" /> <setter property="horizontaloffset" value="155" /> <setter property="placement" value="top" /> <setter property="background" value="transparent" /> <setter property="borderbrush" value="transparent" /> <setter property="borderthickness" value="0" /> <setter property="template"> <setter.value> <controltemplate targettype="tooltip"> <stackpanel> <grid width="200" minheight="50" horizontalalignment="left"> <border background="black"/> <stackpanel margin="5"> <contentpresenter margin="5" content="{templatebinding content}"/> </stackpanel> </grid> <polygon horizontalalignment="left" fill="black"> <polygon.points> <point x="0" y="0"/> <point x="20" y="0"/> <point x="30" y="30"/> </polygon.points> </polygon> </stackpanel> </controltemplate> </setter.value> </setter> </style>
i think add tooltip pushpin this:
var pin = new pushpin(); pin.location = new location(45, -70); tooltipservice.settooltip(pin, new tooltip() { content = "custom text", style = application.current.resources["custominfoboxstyle"] style }); mymap.children.add(pin);
http://rbrundritt.wordpress.com
Bing Maps > Bing Maps REST, SOAP, Spatial Data Services
Comments
Post a Comment