Commit 94cbb65a1d51e7ff15006934829a014b40c169ca

Authored by Edmar Moretti
1 parent d80bc604

suporte a TMS em ogc.php

Showing 1 changed file with 67 additions and 0 deletions   Show diff stats
exemplos/googlemapscomogc.php 0 → 100644
... ... @@ -0,0 +1,67 @@
  1 +<!DOCTYPE>
  2 +<html>
  3 +<head>
  4 +<meta http-equiv="content-type" content="text/html; charset=utf-8" />
  5 +<style type="text/css">
  6 +body {
  7 + margin: 0;
  8 + padding: 10px 20px 20px;
  9 + font-family: Arial;
  10 + font-size: 16px;
  11 +}
  12 +
  13 +#map-container {
  14 + padding: 6px;
  15 + border-width: 1px;
  16 + border-style: solid;
  17 + border-color: #ccc #ccc #999 #ccc;
  18 + -webkit-box-shadow: rgba(64, 64, 64, 0.5) 0 2px 5px;
  19 + -moz-box-shadow: rgba(64, 64, 64, 0.5) 0 2px 5px;
  20 + box-shadow: rgba(64, 64, 64, 0.1) 0 2px 5px;
  21 + width: 100%;
  22 +}
  23 +
  24 +#map {
  25 + width: 100%;
  26 + height: 600px;
  27 +}
  28 +</style>
  29 +</head>
  30 +<body>
  31 + <div id="map-container">
  32 + <div id="map"></div>
  33 + </div>
  34 +</body>
  35 +<script src="http://maps.google.com/maps/api/js?sensor=false"></script>
  36 +<script type="text/javascript">
  37 + var center = new google.maps.LatLng(-20,-54);
  38 + mapGM = new google.maps.Map(document.getElementById("map"), {
  39 + zoom: 4,
  40 + center: center
  41 + });
  42 +<?php
  43 +if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')){
  44 + echo "camada = '_wbiomashp';";
  45 +}
  46 +else{
  47 + echo "camada = '_lbiomashp';";
  48 +}
  49 +?>
  50 + camadaOGC = new google.maps.ImageMapType({
  51 + getTileUrl: function(coord, zoom) {
  52 + var url = "../ogc.php?&cache=nao" +
  53 + "&Z=" + zoom + "&X=" + coord.x + "&Y=" + coord.y +
  54 + "&LAYERS="+camada+"&tema="+camada+"&REQUEST=getMap&TIPOIMAGEM=nenhum&service=wms";
  55 + return url
  56 + },
  57 + tileSize: new google.maps.Size(256, 256),
  58 + isPng: true,
  59 + name: camada
  60 + });
  61 + mapGM.overlayMapTypes.insertAt(0, camadaOGC);
  62 +
  63 +
  64 +
  65 + </script>
  66 +</html>
  67 +
... ...