Register  |  Login
ThinkGeo - GPS Tracking and Mapping Solutions  |  Visit the Wiki  |  Find us on: Twitter Facebook Google+ LinkedIn

Discussion Forums

The online community for users of Map Suite GIS components

How do I add Google map to overlay layer?
Last Post 04-30-2012 04:41 PM by Gary. 21 Replies.
Printer Friendly
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Page 1 of 212 > >>
Author Messages Resolved
sumethUser is Offline
Level 3
Level 3
Posts:67
Avatar

--
11-24-2011 03:33 AM

 GoogleOverlay gg = new GoogleOverlay();

            gg.TileType = TileType.MultipleTile;
            gg.GoogleMapType = GoogleMapType.Satellite;
            gg.Name = "gg";
            ////gg.ServerUris.Add(new Uri(""));
            //gg.ImageFormat = GoogleImageFormat.Png8;

            Map1.Overlays.Add(gg);

Why I got error? How do I add Google map to overaylayer.

 

GaryUser is Offline
MVP
MVP
Posts:1914
Avatar

--
11-24-2011 01:48 PM

Hello sumeth,

What error are you meet? Your code looks like ok, but not complete, I'm not sure if it's because you didn't paste them all.

Please have a look at the code below, I believe you can use it directly and compare to your full code:


Map1.MapUnit = GeographyUnit.Meter;
            Map1.CurrentExtent = new RectangleShape(-13939426.6371, 6701997.4056, -7812401.86, 2626987.386962);
            //WorldMapKitWmsSilverlightOverlay baseOverlay = new WorldMapKitWmsSilverlightOverlay();
            GoogleOverlay baseOverlay = new GoogleOverlay();
            baseOverlay.TileType = TileType.MultipleTile;
            baseOverlay.GoogleMapType = GoogleMapType.Satellite;
            baseOverlay.Name = "gg";
            Map1.Overlays.Add(baseOverlay);
            Map1.Refresh();

Regards,

Gary

Need to know how to do something with Map Suite? Check our Wiki Code Samples Library and view the source code of any sample right in your web browser.

sumethUser is Offline
Level 3
Level 3
Posts:67
Avatar

--
11-24-2011 07:28 PM

Yesterday , I attacch files but it not show.

I copy your code and add it.

It hasn't error.But when I panning or zooming  I got this. It  same error my code.

(I clear all Overlay before add it)

 

images by free.in.th

GaryUser is Offline
MVP
MVP
Posts:1914
Avatar

--
11-25-2011 12:03 PM

Hi sumeth,

The exception always happened when the request image is unavailable or isn’t in Silverlight allowed image format, such as “Bitmap”.

Are you using the trail Google Map key for development? There is a property in GoogleOverlay named ClientID, if it’s empty, the map suite will work under evaluation license, in that case, I think you have excessed the query limit of 1000 unique (different) image requests per day. Please refer to code.google.com/apis/maps/documenta...ps/#Limits for detail.

Sorry for the inconvenience.

Gary

Need to know how to do something with Map Suite? Check our Wiki Code Samples Library and view the source code of any sample right in your web browser.

sumethUser is Offline
Level 3
Level 3
Posts:67
Avatar

--
11-27-2011 08:14 PM
How do I set google api key?

Is this " baseOverlay.ServerUris.Add(new Uri(".................")); " ?
GaryUser is Offline
MVP
MVP
Posts:1914
Avatar

--
11-28-2011 08:50 AM
Hello sumeth,

No, there is a property named ClientID, so you can use baseOverlay.ClientId = "" to set the api key.

Regards,

Gary

Need to know how to do something with Map Suite? Check our Wiki Code Samples Library and view the source code of any sample right in your web browser.

sumethUser is Offline
Level 3
Level 3
Posts:67
Avatar

--
11-28-2011 10:02 PM

thanks you very much.

I will try to do with your API document. In the past I don't see API document.
sorry for more questions.
And I will be ask you if I not found solution.

Regard
Sumeth (Beginner Developer)  :)

GaryUser is Offline
MVP
MVP
Posts:1914
Avatar

--
11-29-2011 08:37 AM
Hello sumeth,

You are welcome, please feel free to let us know your problems.

Regards,

Gary

Need to know how to do something with Map Suite? Check our Wiki Code Samples Library and view the source code of any sample right in your web browser.

onurUser is Offline
Level 1
Level 1
Posts:10
Avatar

--
04-12-2012 09:43 AM
Hello

I have a problem with showing google map too. After initialize my program, i m getting google map images. But when i make zoom in our out, i m losing google map and there is no google map images around my map. So what is the problem do you think? By the way I have set google map api key.
Thanks...

Onur
GaryUser is Offline
MVP
MVP
Posts:1914
Avatar

--
04-12-2012 04:51 PM
Hello onur,

Thanks for your post, if your api key is valid, first have you checked if you use the cache? Second have you try to use different browser to test it?

Is that possible you can provide a sample to us?

Regards,

Gary

Need to know how to do something with Map Suite? Check our Wiki Code Samples Library and view the source code of any sample right in your web browser.

onurUser is Offline
Level 1
Level 1
Posts:10
Avatar

--
04-13-2012 02:33 AM
Hi;

I uploaded a video on youtube. You can watch the problem from there.The link is ;

http://www.youtube.com/watch?v=_JweAhJJBGY&feature=youtu.be

And also I wanna add my code snippet in here.

GoogleOverlay google = new GoogleOverlay();
google.ClientId="AIzaSyBu0jMaW91YXXfOR28N2ZzvjJYR6Uk5Qu8";
google.GoogleMapType = GoogleMapType.Roadmap;
google.Projection = "EPSG:900913";
google.Name = "Road";
google.TileType = TileType.MultipleTile;
_map.Overlays.Add(google);

Thanks.

Onur
GaryUser is Offline
MVP
MVP
Posts:1914
Avatar

--
04-16-2012 11:00 AM
Hello onur,

Thanks for your video and code, the code is no problem, and in the video, looks like it has a little slow to load the tiles every time you zoom in or out, could you please debug in your web browser and see what's the request and response when you meet the problem?

Regards,

Gary

Need to know how to do something with Map Suite? Check our Wiki Code Samples Library and view the source code of any sample right in your web browser.

onurUser is Offline
Level 1
Level 1
Posts:10
Avatar

--
04-18-2012 05:18 AM
Hi

How can i get the request and response values of web browser?

Thanks
GaryUser is Offline
MVP
MVP
Posts:1914
Avatar

--
04-18-2012 09:52 AM
Hello onur,

That depends on your browser, if you use FireFox, you can install the addon FireBug, if you use IE and Chrome, you can press F12, they will both open the browser debug tool. And you can oversee the network.

Regards,

Gary

Need to know how to do something with Map Suite? Check our Wiki Code Samples Library and view the source code of any sample right in your web browser.

onurUser is Offline
Level 1
Level 1
Posts:10
Avatar

--
04-19-2012 02:17 AM

Hi

I debuged my browser with iexplorer and when i couldnt get the google images, the response was 

Key Value
Response HTTP/1.1 403 Forbidden
Key Value
Content-Type image/png
Key Value
Vary Accept-Language
Key Value
Date Thu, 19 Apr 2012 06:55:15 GMT
Key Value
Server staticmap
Key Value
Content-Length 7647
Key Value
X-XSS-Protection 1; mode=block
Key Value
X-Frame-Options SAMEORIGIN

Hopefully you can give me solution :) Thanks...

Onur

GaryUser is Offline
MVP
MVP
Posts:1914
Avatar

--
04-19-2012 04:56 PM

Hello Onur,

Please see the attached image, when you press F12, then click the network, then click start capturing, now when the google image stop showing, you can check what's the problem in the request and response.

Regards,

Gary

Need to know how to do something with Map Suite? Check our Wiki Code Samples Library and view the source code of any sample right in your web browser.

onurUser is Offline
Level 1
Level 1
Posts:10
Avatar

--
04-20-2012 07:48 AM

Hello Gary;

I've already did it and my previous message was the result of the web browser debug.

Key Value
Response HTTP/1.1 403 Forbidden
Key Value
Content-Type image/png
Key Value
Vary Accept-Language
Key Value
Date Thu, 19 Apr 2012 06:55:15 GMT
Key Value
Server staticmap
Key Value
Content-Length 7647
Key Value
X-XSS-Protection 1; mode=block
Key Value
X-Frame-Options SAMEORIGIN

This is the response of google api when i couldnt get the google images...

Thanks...
GaryUser is Offline
MVP
MVP
Posts:1914
Avatar

--
04-20-2012 10:26 AM
Hello onur,

The information is too few, but I can do some guess on this.

"Response HTTP/1.1 403 Forbidden" means server decline your request, could you please check your api keys, if it's a trail Google Map key, as I said above, it will have request time limit, maybe you reached that limits.

Or could you please provide your sample to me? I can do some test on it.

Regards,

Gary

Regards,

Gary

Need to know how to do something with Map Suite? Check our Wiki Code Samples Library and view the source code of any sample right in your web browser.

onurUser is Offline
Level 1
Level 1
Posts:10
Avatar

--
04-24-2012 03:21 AM

Hi Gary ;

Which option should I select for creating google api key?
Create Client ID,Create New Server Key,Create New Browser Key ?? I have used the first one 'Create Client ID' ...

This is my code sample. I've just created one silverlight application and use these codes ;

_map.MapUnit = MapUnit.Meter;
GoogleOverlay google = new GoogleOverlay();

google.ClientId = "683108358027-nikc8kd7b8qrsbdhulkmskrgv7ebhufp.apps.googleusercontent.com";
google.GoogleMapType = GoogleMapType.Roadmap;
google.Name = "Road (Overlay)";
google.TileType = TileType.MultipleTile;
_map.Overlays.Add(google);
_map.MapTools.OverlaySwitcher.SingleSelectedOverlays.Add(google);
_map.MapTools.OverlaySwitcher.Refresh();
_map.Refresh();

And this is url of my application

http://cbs.kahramanmaras.bel.tr:8888/testapp/MxcSilverlightWebClientTestPage.html
GaryUser is Offline
MVP
MVP
Posts:1914
Avatar

--
04-24-2012 10:34 AM

Hello onur,

Thanks for your online sample, when I test on it, I saw a exception said the boundingbox is not right, could you please check your boundingbox?

Regards,

Gary

Need to know how to do something with Map Suite? Check our Wiki Code Samples Library and view the source code of any sample right in your web browser.

You are not authorized to post a reply.
Page 1 of 212 > >>


Active Forums 4.2