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

  • SEARCH
  • Home
  • 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 5969233
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T20:12:03+00:00 2026-05-22T20:12:03+00:00

I have a Silverlight application that generates a lot of Google Maps objects on

  • 0

I have a Silverlight application that generates a lot of Google Maps objects on the Silverlight site. For example a Map is created like this:

var map = HtmlPage.Window.CreateInstance(@"google.maps.Map", container, mapOptions);
var center = (ScriptObject)_map.Invoke("getCenter");

Everything works fine. But now I need to access the map object from Javascript directly. I think it could be done by exposing a map property as ScriptableMember and use it from Javascript. But that”s a bit odd because the map object lives already in the browser. But how do I access it?

Update

Just to make clearer what I’m talking about

Let’s say I have created my map as shown above. Now I have a loaded Javasript file with this function:

function ReadMapCenter()
{
  //Need the map object in Javascript
  map.getCenter();
}

How can I access the existing map Object from Javascript?

  • 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-05-22T20:12:04+00:00Added an answer on May 22, 2026 at 8:12 pm

    If you just expose it as type ScriptObject I think the bridge will simply unpack the scripted object rather than create yet another layer of wrapping for it.

    Alternative

    Don’t use CreateInstance

    In your javascript at the global leve use:-

    var map;
    function createMap(container, mapOptions)
    {
         if (!map)
         {
            map = new google.maps.Map(container, mapOptions);
         }
         return map;
    }
    

    now your javascript has a map global it can use.

    In silverlight use:-

     var map = HtmlPage.Window.Invoke("createMap", container, mapOptions);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Silverlight application that is building a URL. This URL is a
We have an application generated using the Sculpture software package . That means the
I'm developing a Silverlight Business Application, using a RIA service, which is returning POCO
I would like to have the EntityFramework4 model (.edmx and .context.tt) in a Class
I have been dabbling in WCF RIA with Silverlight for the past few weeks
I have spent a while going over all of the examples on http://www.silverlight.net/learn/quickstarts/ And
I'm currently trying out Silverlight with RIA Services. I'm implementing a simple login form.
Ok, I’ve spent two days on this and am losing confidence in both myself
We're using a combination of Silverlight 4, .net 4 and VS2010 for several internal
Hey, I was wondering if you guys could see what is wrong/suggest a solution.

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.