Showing posts with label gis. Show all posts
Showing posts with label gis. Show all posts

Feb 25, 2014

OpenStreetMaps layer in Google Maps API V3

Adding an OSM layer in Google Maps is very easy, since the V3 API provides a functionality for adding custom layers (even WMS!).

First, you need to define custom map settings, to include your layer. It's good to change the layer chooser to 'dropdown' too.
map = new google.maps.Map(document.getElementById("gmap_canvas"), {
 scaleControl: true,
 mapTypeId: google.maps.MapTypeId.ROADMAP,
 mapTypeControlOptions: {
  mapTypeIds: [
   "OSM",
   google.maps.MapTypeId.ROADMAP, 
   google.maps.MapTypeId.SATELLITE, 
   google.maps.MapTypeId.HYBRID, 
   google.maps.MapTypeId.TERRAIN
  ],
  style: google.maps.MapTypeControlStyle.DROPDOWN_MENU
 }
});
Next, you define your OSM layer like so:
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: "OSM",
 maxZoom: 18
}));
And there you go. You can check the demo out at: http://poi.kafol.net/


Jan 8, 2010

Windows 7/Vista & ArcGIS & ESRI License Manager

It seems that ESRI License Manager has difficulties running in Windows 7 or Vista – the License server fails to start at boot or on demand in License Manager Tools.
Consequently, ArcGIS didn’t start because there was no license server running. Obviously this problem doesn’t occur if the license server is running on another machine in the network.
At first I tried the quick and dirty solution – to manually start the server daemon and see where it fails.
I ran Command Prompt as an administrator:
Untitled
Now, the server is called lmgrd.exe, so if you navigate to C:\Program Files\ESRI\License\arcgis9x and start lmgrd, it says that there is no license specified.
So I typed the location of the license (it was in the same folder), ran the program in the foreground:
lmgrd –c license.lic -z
I kept the command prompt open, and ArcGIS started succesfully.
But this isn’t really a long term solution, since this method would require manual server start in the command prompt everytime I would want to start ArcGIS.
So I thought, maybe the problem is that the server can’t find the license file. After some googling, I found out that the environment variable LM_LICENSE_FILE wasn’t set. It says on the support page that you’d need to enter port@machine-name for the variable value, but since we’re running the server on the local machine, you just need to enter your C:\Path\to\your\license.lic.
sd
When all goes well with License Manager Tools, you might still need to enter "localhost" in the ArcGIS desktop manager in the license server.
If anyone has a better solution or information, please post in the comments.
UPDATE:
After further experimentation I found out that you also need the Sentinel driver to successfuly run License Manager on Windows 7. Don't know why, but it works. You should install Sentinel driver first, then the license manager, so that everything for the license works before you install ArcGIS. That way you won't have to manually configure ArcGIS for license after it has been installed. You have less work that way.