Saturday, 1st August 2009 at 9:29 pm | 20 Comments »

This update has a minor bug fix and adds support for Russian language.

  • Fix for GUnload() and GBrowserIsCompatible() being called when not available/required.
  • Russian language added – translation by Fat Cower.

20 Responses to “WP Geo 3.0.9.1”

  1. sxtone says:

    I would like to add custom features about custom maptile!
    How to insert my custom maptile code into wp-geo.php file ?

    my code demo url

    Paste my code:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    
    var mapBounds = new GLatLngBounds(new GLatLng(30.7124714707, 111.3009131), new GLatLng(30.73387748, 111.329087596));
    var mapMinZoom = 8;
    var mapMaxZoom = 15;
    var map;
     
    if (GBrowserIsCompatible()) {
     
    map = new GMap2( document.getElementById("map"), { backgroundColor: '#fff' } );
    map.setCenter(mapBounds.getCenter(), map.getBoundsZoomLevel( mapBounds ));
    map.addControl(new GSmallMapControl());
    map.addControl(new GMapTypeControl());
    map.setMapType(G_SATELLITE_MAP);
    map.enableContinuousZoom();
    map.enableScrollWheelZoom();
     
    var gcr = GMapType.prototype.getCopyrights;
    GMapType.prototype.getCopyrights = function(bounds,zoom) {
    return ["©2009 sxtone.com"].concat(gcr.call(this,bounds,zoom));
    }
     
    var tilelayer = new GTileLayer(GCopyrightCollection(''), mapMinZoom, mapMaxZoom);
    var mercator = new GMercatorProjection(mapMaxZoom+1);
     
    tilelayer.getTileUrl = function(tile,zoom) {
    if ((zoom  mapMaxZoom)) {
    return "http://www.owblog.cn/maptile/none.png";
    } 
    var ymax = 1 << zoom;
    var y = ymax - tile.y -1;
    var tileBounds = new GLatLngBounds(
    mercator.fromPixelToLatLng( new GPoint( (tile.x)*256, (tile.y+1)*256 ) , zoom ),
    mercator.fromPixelToLatLng( new GPoint( (tile.x+1)*256, (tile.y)*256 ) , zoom )
    );
     
    if (mapBounds.intersects(tileBounds)) {
    return "tile/"+zoom+"/"+tile.x+"/"+y+".png";
    } else {
    return "http://www.owblog.cn/maptile/none.png";
    }
    }
     
    tilelayer.isPng = function() { return true;};
     
    overlay = new GTileLayerOverlay( tilelayer );
    map.addOverlay(overlay);
     
    }else {
    alert("sorry, not Compatible Google Map API.");
    }//11
  2. sxtone says:

    Key part of my custom maptile code:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    
    var gcr = GMapType.prototype.getCopyrights;
    GMapType.prototype.getCopyrights = function(bounds,zoom) {
    return ["©2009 sxtone.com"].concat(gcr.call(this,bounds,zoom));
    }
     
    var tilelayer = new GTileLayer(GCopyrightCollection(), mapMinZoom, mapMaxZoom);
    var mercator = new GMercatorProjection(mapMaxZoom+1);
     
    tilelayer.getTileUrl = function(tile,zoom) {
    if ((zoom mapMaxZoom)) {
    return “http://www.owblog.cn/maptile/none.png”;
    }
    var ymax = 1 << zoom;
    var y = ymax – tile.y -1;
    var tileBounds = new GLatLngBounds(
    mercator.fromPixelToLatLng( new GPoint( (tile.x)*256, (tile.y+1)*256 ) , zoom ),
    mercator.fromPixelToLatLng( new GPoint( (tile.x+1)*256, (tile.y)*256 ) , zoom )
    );
     
    if (mapBounds.intersects(tileBounds)) {
    return "tile/"+zoom+"/"+tile.x+"/"+y+".png";
    } else {
    return "http://www.owblog.cn/maptile/none.png";
    }
    }
     
    tilelayer.isPng = function() { return true;};
     
    overlay = new GTileLayerOverlay( tilelayer );
    map.addOverlay(overlay);
  3. Ben says:

    @sxtone – An interesting idea…
    Are you familiar with developing WordPress plugins at all?

    Having a quick look through your code, I think that they key bit of information you need to add a tilelayer is a javascript reference to the ‘map’ – is that right?

    If so, I can probably add in a WordPress Filter so that it is possible to add additional Javascript code via another plugin (or your theme’s functions.php file).

    I will try to have a look into it when I have time….

  4. sxtone says:

    @Ben-yeah!I need to add a tilelayer!

    Thank you for the reminder, I give it a try…but I am not familiar with developing WordPress plugins at all.

    Why does not directly insert into wp-geo.php file’s mapScriptsInit()、init_wp_geo_map_admin()?

  5. Ben says:

    @sxtone – I’ll try and have a little look at how it could be added.

    The idea behind creating a filter so you can add the extra script via the functions.php file or another plugin is so that if you need to customise the script for your own purposes, you will still be able to auto-upgrade the main WP Geo bit of the plugin when a new release is available.

  6. sxtone says:

    @ben-After the entry of the code can not run.
    Results directly to me please…

  7. sxtone says:

    @ben-I do not understand the development of wordpress plugin.

  8. sxtone says:

    Suggest parse GEO RSS,then insert data into MySQL table markers for search!

  9. sxtone says:

    @Ben-First,Thank your wp-geo-tiles.php and add filter hook code!

    Why not appear wp-geo-tiles in my blog’s plugin list?

    I have upload all files(wp-geo and wp-geo-tile), install and activate…

    • Ben says:

      The wp-geo-tile.php file should go in your main plugins folder, not the WP Geo plugin folder. It should then appear in your installed plugins as “WP Geo: My tiles”.

  10. sxtone says:

    @Ben-

    Once again thank you!

    I’m so glad the problem resolved!

    Screenshots url:

    http://www.owblog.cn/ok.jpg

  11. sxtone says:

    @Ben-
    suggestion set Common Interface for user javascript run.As markerClusterer for large amounts of markers.Etc.

  12. Aaron says:

    Hey I have been using your plugin for a while and really enjoy it but I tried to search how to add text into the tooltip here and on google and I can not seem to find anyway to quickly add text to my markers tooltip. The website is Ali Athari Fine Jewelry and i only need to change it for one map so maybe you could tell me how to change some of the code to reflect what I need? Thanks for any support or answers.

    -Aaron.

  13. Rob says:

    Hello Ben,

    I just installed your plugin and I must say I love it. Still playing around with before really publishing it on my weblog :).

    Small question: I noticed that the widget only shows when in the current post or page a map is active. Is it possible to show the widget always? Would be very nice…

    Thanks for writing this great plugin.

    Regards,
    Rob.

  14. Nishit Shah says:

    Hey!

    Thanks 4 the great plugin. We use it extensively for our site. Love it.

    There is a small question, is it possible to have different zoom levels for each map on each page / post ?

    Thanks
    Nishit

  15. Tom says:

    Hey Ben,

    I saw sxtone exclaiming that he got the Maps Overlay to work, but since this is an older post all of his links to his site are now dead.

    Did you ever add a filter to the plugin to allow for custom map overlays? If so, could you point me in the right direction for documentation?

    Thanks!

Leave a Reply