Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9229813
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T05:39:56+00:00 2026-06-18T05:39:56+00:00

Possible Duplicate: How can I add programmatically add a PushPin, and could I make

  • 0

Possible Duplicate:
How can I add programmatically add a PushPin, and could I make it have a custom image?

In WP7 using bing maps control, I used an image as a pushpin, but it was slightly offset due to how it renders the pushpin, so I used the PositionOrigin to center it properly like this:

 <my:Pushpin Location="{Binding Location}" 
                                    PositionOrigin="Center"MouseLeftButtonUp="pin_click"
                                    Template="{StaticResource PushpinControlTemplate1}" >
                    </my:Pushpin>

In The new Map control for WP8, i try and sung this setting, and the app just crashes to an unhandled exception in App.xaml.cs with no information.

This is the windows Phone 8 code:

  toolkit:Pushpin PositionOrigin="Center"  MouseLeftButtonUp="pin_click" 
GeoCoordinate="{Binding Location1}"  Template="{StaticResource PushpinControlTemplate1}"/

They both use this template:

 <ControlTemplate x:Key="PushpinControlTemplate1" TargetType="my:Pushpin">
        <Grid>
       <Image Width="45" Height="45" Source="{Binding Arrow}"/>
        </Grid>
    </ControlTemplate>

Any ideas how to offset or centre this pushpin?

EDIT: Example images:


(source: goapr.co.uk)

The left image with the standard pushpins shows the tip matches the transit stop on the map (as it should). My custom images should be on top of the transit stops on the right image, but they are not.
The PositionOrigin setting used to almost fix this, but not possible in WP8 it seems.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T05:39:57+00:00Added an answer on June 18, 2026 at 5:39 am

    PushPins are aligned so their bottom-left point is at the GeoCoordinate. That’s done by the default of of their MapOverlay PositionOrigin being set to 0,1. If you set the MapOverlay PositionOrigin to 0.5,0.5 MapOverlay will align it’s center towards the GeoCoordinate. For example, UserLocationMarker uses PositionOrigin of 0.5,0.5 to align it’s visual center to the coordinate.

    Try playing around with the PushPin.PositionOrigin and see if that solves your problem. PushPin.PositionOrigin of 0.5,0.5 would be a good starting value depending on the effect you’re trying to achieve. Remember, PushPin and UserLocationMarker are just fancy MapOverlay so when in doubt revert to plain MapOverlays to test stuff out.

    <!-- Default Style used for Pushpin -->
    <Style TargetType="maptk:Pushpin">
        <Setter Property="PositionOrigin" Value="0,1" />
    </Style>
    
    <!-- Default Style used for MePOI -->
    <Style TargetType="maptk:UserLocationMarker">
        <Setter Property="PositionOrigin" Value="0.5,0.5" />
    </Style>
    

    One reason why you might have gotten exceptions when upgrading from WP7.5 to WP8 is because PositionOrigin has changed from Bing Maps custom data type to a simplified Point X,Y structure.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: How can I add resizable widgets in Qt Creator? I am using
Possible Duplicate: Can I scroll a ScrollView programmatically in Android? I have a chat
Possible Duplicate: How can I lock a file using java (if possible) I have
Possible Duplicate: Can I add custom methods/attributes to built-in Python types? In Ruby you
Possible Duplicate: javascript executing function after full image load Im using JQuery to programmatically
Possible Duplicate: How can I add loading text/image to images that are still loading
Possible Duplicate: How are SSL certificate server names resolved/Can I add alternative names using
Possible Duplicate: How can I programmatically add a contact? With the help of a
Possible Duplicate: How can I add numbers in a bash script I have a
Possible Duplicate: Can I comment a JSON file? We are using a .json file

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.