0

Thanks a stack for a great post! This was a first for me and I was amazed at the result.

Can anyone help with how to set the coordinates during runtime?

Thanks again!

0

hey,,, thanx for the code,,,,
it had been a greate help...
I just wanted to ask is there any way to intorduce the search option...
as in the one you use to search a particular address

0

Nice work i must confess, mine runs. However, it displays the error message shown below whenever i click on the form. Secondly, how do i navigate through the solution to view images or satelite navigation. I would be greatly pleased if a kind response will be given to me. Thanks.

0

Why components does not work in Public Class GoogleControl ???
i.e. when I add a control (Label) to Form1 and add some code to Public Sub Map_MouseMove so then noting happens.?? Label never cvhanges??

0

Just cannot get this to work. The form just shows the text of the GoogleMap.htm as text, not as a map. I've gone over the instructions many times now and I can't see what is wrong. ANy help?

Thanks!

0

Messed with this for several hours, very frustrated, it just will not work. It just shows the contents of the GoogleMap.htm file as text, not as a map. No clue why.

0

Hi
Can you show mw how to add markers in the map. I do have loop of lat and lng. and also set map in center.

Cheers Harry

0

This is a shot in the dark as this post is a few years old but:

Have you ever encountered a JSON script error? I modified the Google JS API v3 code to create markers for each record from a SqlDataReader (working flawless) while creating an InfoWindow for each marker as well (also working flawlessly). I had it to the point where you can click different markers and have an InfoWindow for each one come up with info from that record in the database. All of a sudden when I click a marker I am getting a JSON script error. The InfoWindow very quickly opens and closes.

0

Hello, I get this error when I run the program.. I followed the steps correctly.. but I got this script error.. Do you have a tip on how to fix this?

Hoping for a reply!
Have a nice day!

Attachments scriptError.png 14.1 KB
0

hello
Can you help me?
I did sample a few days ago and works fine, but suddenly stop to work, just load the controls and markers but the map not.
mapa.JPG

Edited by Aaron_8

0

this code has been working all along my application and suddenly stopped, upon debugging it seems the program fails on Webbrowser_DocumentCompleted event when it's calling function Initialize() causing the whole application to freeze. Any idea of what has changed?

0

Try a static variable so DocumentCompleted fires just once (I had the same problem):

    Private Sub WebBrowser1_DocumentCompleted(ByVal sender As Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs)
        'Initialize the google map with the initial settings.'
        'The Initialize script function takes four parameters'
        'zoom, lat, lng, maptype.  Call the script passing the'
        'parameters in.'
        Static bInit As Boolean = False
        If bInit Then Exit Sub
        WebBrowser1.Document.InvokeScript("Initialize", New Object() {InitialZoom, InitialLatitude, InitialLongitude, CInt(InitialMapType)})
        bInit = True
    End Sub
0

If WebBrowser1_DocumentCompleted is leaved out like it was initially the other way round is to add an instruction if (map) return; at the start of Initialize() because for some reason looks like the javascript is modified, which makes the DocumentCompleted to be called again, which again invokes Initialize() and so in an infinit loop.

        function Initialize(zoomLevel,lat,lng,type){  
            //Get the type of map to start.
            //Need to convert the GoogleMapType enum
            //to an actual Google Map Type

            if(map) return;
            var MapType;

            switch (type)
            {
            // .... 
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.