Using Openstreet MAP (OSM) with GoogleMaps extension

Answered
0
0

I want to use OpenStreetMap tiles instead of Google Maps. I found that post:

Without modifying the extension, is to add a JavaScript component to the page (in Wisej 2 you don’t need the JavaScript component and you can use the new ClientEvents property), and add a JavaScriptEvent to the map control for the “initialized” event whit this code:

this.map.mapTypes.set("OSM", new google.maps.ImageMapType({
    getTileUrl: function (coord, zoom) {
        return "http://tile.openstreetmap.org/" + zoom + "/" + coord.x + "/" + coord.y + ".png";
    },
    
    tileSize: new google.maps.Size(256, 256),
    name: "OpenStreetMap",
    maxZoom: 18
}));
this.map.setMapTypeId("OSM")

Unfortunately, it doesn't seems to work.

Can anyone put a working code here?

Thank you.
  • You must to post comments
Good Answer
0
0

Sorry bro, I work with VbNet

I attach a very basic working project

 

Attachment
  • You must to post comments
0
0

I suggest to use leaflet javascript, I have used it for a big project, it is great with open street map

 

  • Adrian Zagar
    Thank you for answering. Can you add here a very basic sample (prefferable in c#)?
  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.